Console commands declared with the Laravel 13 #[Signature] attribute.
Features
- Read the command signature from the Laravel 13
#[Signature]attribute, soargument()/option()narrowing,hasArgument()/hasOption()and theInvalidConsoleArgumentName/InvalidConsoleOptionNamechecks work for commands migrated fromprotected $signature(e.g. by Rector's Laravel set). As in Laravel, the attribute overrides a$signatureproperty 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