Skip to content

Commit

Permalink
change command template to return actual exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSimal committed Oct 6, 2024
1 parent 1f1a4d0 commit e588536
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions templates/bake/Command/command.twig
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ class {{ name }}Command extends Command
*
* @param \Cake\Console\Arguments $args The command arguments.
* @param \Cake\Console\ConsoleIo $io The console io
* @return int|null|void The exit code or null for success
* @return int The exit code
*/
public function execute(Arguments $args, ConsoleIo $io)
public function execute(Arguments $args, ConsoleIo $io): int
{
return Command::CODE_SUCCESS;
}
}
5 changes: 3 additions & 2 deletions tests/comparisons/Command/testBakePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionPar
*
* @param \Cake\Console\Arguments $args The command arguments.
* @param \Cake\Console\ConsoleIo $io The console io
* @return int|null|void The exit code or null for success
* @return int The exit code
*/
public function execute(Arguments $args, ConsoleIo $io)
public function execute(Arguments $args, ConsoleIo $io): int
{
return Command::CODE_SUCCESS;
}
}

0 comments on commit e588536

Please sign in to comment.