@@ -23,10 +23,12 @@ namespace App\Commands;
2323
2424use CodeIgniter\CLI\AbstractCommand;
2525use CodeIgniter\CLI\Attributes\Command;
26+ use Override;
2627
2728#[Command(name: 'app:greet', description: 'Prints a greeting.', group: 'App')]
2829class AppGreet extends AbstractCommand
2930{
31+ #[Override]
3032 protected function execute(array $arguments, array $options): int
3133 {
3234 $this->getOutput()->write('Hello!', 'green');
@@ -60,6 +62,7 @@ namespace App\Commands;
6062
6163use CodeIgniter\CLI\AbstractCommand;
6264use CodeIgniter\CLI\Attributes\Command;
65+ use Override;
6366
6467#[Command(
6568 name: 'app:deploy',
@@ -69,6 +72,7 @@ use CodeIgniter\CLI\Attributes\Command;
6972)]
7073class AppDeploy extends AbstractCommand
7174{
75+ #[Override]
7276 protected function execute(array $arguments, array $options): int
7377 {
7478 // Reachable as `php spark app:deploy`, `php spark app:ship`, or `php spark deploy`.
@@ -89,6 +93,7 @@ namespace App\Commands;
8993
9094use CodeIgniter\CLI\AbstractCommand;
9195use CodeIgniter\CLI\Attributes\Command;
96+ use Override;
9297
9398#[Command(
9499 name: 'app:reindex',
@@ -98,6 +103,7 @@ use CodeIgniter\CLI\Attributes\Command;
98103)]
99104class AppReindex extends AbstractCommand
100105{
106+ #[Override]
101107 protected function execute(array $arguments, array $options): int
102108 {
103109 // Not shown by `php spark list`, but `php spark app:reindex` still runs it.
@@ -134,6 +140,7 @@ namespace App\Commands;
134140
135141use CodeIgniter\CLI\AbstractCommand;
136142use CodeIgniter\CLI\Attributes\Command;
143+ use Override;
137144
138145#[Command(
139146 name: 'app:status',
@@ -143,6 +150,7 @@ use CodeIgniter\CLI\Attributes\Command;
143150)]
144151class AppStatus extends AbstractCommand
145152{
153+ #[Override]
146154 protected function execute(array $arguments, array $options): int
147155 {
148156 $this->getOutput()->write(json_encode(['status' => 'ok'], JSON_THROW_ON_ERROR));
@@ -181,10 +189,12 @@ namespace App\Commands;
181189use CodeIgniter\CLI\AbstractCommand;
182190use CodeIgniter\CLI\Attributes\Command;
183191use CodeIgniter\CLI\Input\Argument;
192+ use Override;
184193
185194#[Command(name: 'app:greet', description: 'Greets people.', group: 'App')]
186195class AppGreet extends AbstractCommand
187196{
197+ #[Override]
188198 protected function configure(): void
189199 {
190200 $this
@@ -208,6 +218,7 @@ class AppGreet extends AbstractCommand
208218 ));
209219 }
210220
221+ #[Override]
211222 protected function execute(array $arguments, array $options): int
212223 {
213224 // ...
@@ -238,10 +249,12 @@ namespace App\Commands;
238249use CodeIgniter\CLI\AbstractCommand;
239250use CodeIgniter\CLI\Attributes\Command;
240251use CodeIgniter\CLI\Input\Option;
252+ use Override;
241253
242254#[Command(name: 'app:publish', description: 'Publishes assets.', group: 'App')]
243255class AppPublish extends AbstractCommand
244256{
257+ #[Override]
245258 protected function configure(): void
246259 {
247260 $this
@@ -282,6 +295,7 @@ class AppPublish extends AbstractCommand
282295 ));
283296 }
284297
298+ #[Override]
285299 protected function execute(array $arguments, array $options): int
286300 {
287301 // ...
@@ -346,10 +360,12 @@ namespace App\Commands;
346360use CodeIgniter\CLI\AbstractCommand;
347361use CodeIgniter\CLI\Attributes\Command;
348362use CodeIgniter\CLI\Input\Option;
363+ use Override;
349364
350365#[Command(name: 'logs:clear', description: 'Clears logs.', group: 'Housekeeping')]
351366class ClearLogs extends AbstractCommand
352367{
368+ #[Override]
353369 protected function configure(): void
354370 {
355371 $this->addOption(new Option(
@@ -359,6 +375,7 @@ class ClearLogs extends AbstractCommand
359375 ));
360376 }
361377
378+ #[Override]
362379 protected function interact(array & $arguments, array & $options): void
363380 {
364381 // hasUnboundOption() resolves --force, -f, and --no-force in one call,
@@ -376,6 +393,7 @@ class ClearLogs extends AbstractCommand
376393 $options['force'] = null;
377394 }
378395
396+ #[Override]
379397 protected function execute(array $arguments, array $options): int
380398 {
381399 if ($this->getValidatedOption('force') === false) {
@@ -406,10 +424,12 @@ use CodeIgniter\CLI\AbstractCommand;
406424use CodeIgniter\CLI\Attributes\Command;
407425use CodeIgniter\CLI\Input\Argument;
408426use CodeIgniter\CLI\PromptsForMissingInputInterface;
427+ use Override;
409428
410429#[Command(name: 'app:greet', description: 'Greets people.', group: 'App')]
411430class AppGreet extends AbstractCommand implements PromptsForMissingInputInterface
412431{
432+ #[Override]
413433 protected function configure(): void
414434 {
415435 $this->addArgument(new Argument(
@@ -419,11 +439,13 @@ class AppGreet extends AbstractCommand implements PromptsForMissingInputInterfac
419439 ));
420440 }
421441
442+ #[Override]
422443 protected function getArgumentPromptLabels(): array
423444 {
424445 return ['name' => 'Who should be greeted?'];
425446 }
426447
448+ #[Override]
427449 protected function execute(array $arguments, array $options): int
428450 {
429451 $this->getOutput()->write(sprintf('Hello, %s!', $arguments['name']), 'green');
@@ -477,16 +499,19 @@ namespace App\Commands;
477499
478500use CodeIgniter\CLI\AbstractCommand;
479501use CodeIgniter\CLI\Attributes\Command;
502+ use Override;
480503
481504#[Command(name: 'dev:only', description: 'A dev only command', group: 'Dev')]
482505class DevOnly extends AbstractCommand
483506{
507+ #[Override]
484508 protected function isAvailable(): bool
485509 {
486510 // Only allow this command in the development environment
487511 return ENVIRONMENT === 'development';
488512 }
489513
514+ #[Override]
490515 protected function execute(array $arguments, array $options): int
491516 {
492517 // ...
@@ -526,17 +551,20 @@ use CodeIgniter\CLI\AbstractCommand;
526551use CodeIgniter\CLI\Attributes\Command;
527552use CodeIgniter\CLI\Input\Argument;
528553use CodeIgniter\CLI\Input\Option;
554+ use Override;
529555
530556#[Command(name: 'app:demo', description: 'Demonstrates accessors.', group: 'App')]
531557class AppDemo extends AbstractCommand
532558{
559+ #[Override]
533560 protected function configure(): void
534561 {
535562 $this
536563 ->addArgument(new Argument(name: 'name', required: true))
537564 ->addOption(new Option(name: 'loud', negatable: true, default: false));
538565 }
539566
567+ #[Override]
540568 protected function execute(array $arguments, array $options): int
541569 {
542570 // Directly from the parameters:
@@ -572,10 +600,12 @@ namespace App\Commands;
572600use CodeIgniter\CLI\AbstractCommand;
573601use CodeIgniter\CLI\Attributes\Command;
574602use CodeIgniter\CLI\Table;
603+ use Override;
575604
576605#[Command(name: 'app:report', description: 'Prints a report.', group: 'App')]
577606class AppReport extends AbstractCommand
578607{
608+ #[Override]
579609 protected function execute(array $arguments, array $options): int
580610 {
581611 $output = $this->getOutput();
@@ -621,10 +651,12 @@ use CodeIgniter\CLI\AbstractCommand;
621651use CodeIgniter\CLI\Attributes\Command;
622652use CodeIgniter\CLI\Table;
623653use CodeIgniter\CLI\Verbosity;
654+ use Override;
624655
625656#[Command(name: 'app:sync', description: 'Synchronizes the records.', group: 'App')]
626657class AppSync extends AbstractCommand
627658{
659+ #[Override]
628660 protected function execute(array $arguments, array $options): int
629661 {
630662 $output = $this->getOutput();
@@ -708,10 +740,12 @@ namespace App\Commands;
708740use CodeIgniter\CLI\AbstractCommand;
709741use CodeIgniter\CLI\Attributes\Command;
710742use CodeIgniter\CLI\Input\Argument;
743+ use Override;
711744
712745#[Command(name: 'app:greet', description: 'Greets people.', group: 'App')]
713746class AppGreet extends AbstractCommand
714747{
748+ #[Override]
715749 protected function configure(): void
716750 {
717751 $this
@@ -722,6 +756,7 @@ class AppGreet extends AbstractCommand
722756 ->addUsage('app:greet "Bob the Builder"');
723757 }
724758
759+ #[Override]
725760 protected function execute(array $arguments, array $options): int
726761 {
727762 // ...
@@ -797,6 +832,7 @@ namespace App\Commands;
797832
798833use CodeIgniter\CLI\BaseCommand;
799834use CodeIgniter\CLI\CLI;
835+ use Override;
800836use Throwable;
801837
802838class Publish extends BaseCommand
@@ -811,6 +847,7 @@ class Publish extends BaseCommand
811847 '--dry-run' => 'Print the plan without writing anything.',
812848 ];
813849
850+ #[Override]
814851 public function run(array $params)
815852 {
816853 try {
@@ -853,11 +890,13 @@ use CodeIgniter\CLI\AbstractCommand;
853890use CodeIgniter\CLI\Attributes\Command;
854891use CodeIgniter\CLI\Input\Argument;
855892use CodeIgniter\CLI\Input\Option;
893+ use Override;
856894use Throwable;
857895
858896#[Command(name: 'app:publish', description: 'Publishes something.', group: 'App')]
859897class Publish extends AbstractCommand
860898{
899+ #[Override]
861900 protected function configure(): void
862901 {
863902 $this
@@ -866,13 +905,15 @@ class Publish extends AbstractCommand
866905 ->addOption(new Option(name: 'dry-run', description: 'Print the plan without writing anything.'));
867906 }
868907
908+ #[Override]
869909 protected function interact(array & $arguments, array & $options): void
870910 {
871911 if ($arguments === []) {
872912 $arguments[] = $this->getPrompt()->ask('What should I publish?', null, 'required');
873913 }
874914 }
875915
916+ #[Override]
876917 protected function execute(array $arguments, array $options): int
877918 {
878919 try {
0 commit comments