packagist psalm/plugin-laravel v3.16.2

4 hours ago

A patch release with fixes for translation, view, facade and laravel/ai type inference.

Fixes

  • Accept Closure values in the $replace argument of __(), matching how Laravel's translator calls them with the matched text (#1444)
 __('some.key', ['name' => fn (string $matched): string => strtoupper($matched)]);
-// InvalidArgument: Argument 2 of __ expects array<string, null|scalar>, but array{name: pure-Closure(...)} provided
+// accepted, returns string
  • Report MissingView for $this->view() in test cases using InteractsWithViews (opt-in via findMissingViews) (#1445)
 final class WelcomeTest extends \Illuminate\Foundation\Testing\TestCase
 {
     public function test_it_renders(): void
     {
         $this->view('does.not.exist')->assertSee('hello');
-        // no issue
+        // MissingView: View 'does.not.exist' not found in any of the registered view paths
     }
 }
  • Narrow App::environment() to bool when called with environment names, and to string with no arguments (#1453)
 $isLive = App::environment(['production', 'staging']);
-// string|bool
+// bool
  • 🛡️ Treat Laravel\Ai\Tools\Request::validate() as a taint source like the class's other data accessors: validation constrains shape, not content, so the returned values are still attacker-controlled (#1446)

Full Changelog: v3.16.1...v3.16.2

Don't miss a new plugin-laravel release

NewReleases is sending notifications on new releases.