packagist psalm/plugin-laravel v4.22.6

one hour ago

Console commands declared with the Laravel 13 #[Signature] attribute.

Features

  • Read the command signature from the Laravel 13 #[Signature] attribute, so argument()/option() narrowing, hasArgument()/hasOption() and the InvalidConsoleArgumentName/InvalidConsoleOptionName checks work for commands migrated from protected $signature (e.g. by Rector's Laravel set). As in Laravel, the attribute overrides a $signature property and is read from the concrete class only (#2371)
 #[Signature('app:demo {name} {--tag=*}')]
 final class Demo extends Command { /* ... */ }

 $this->argument('name');
-// array<array-key, mixed>|null|scalar
+// string
 foreach ($this->option('tag') as $tag) {}
-// PossiblyNullIterator, PossiblyInvalidIterator
+// array<int, string>

Full Changelog: v4.22.5...v4.22.6

Don't miss a new plugin-laravel release

NewReleases is sending notifications on new releases.