From e5885368cba0adfecec511fc3dbb42ff7a7a7e57 Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Sun, 6 Oct 2024 09:20:09 +0200 Subject: [PATCH] change command template to return actual exit code --- templates/bake/Command/command.twig | 5 +++-- tests/comparisons/Command/testBakePlugin.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/bake/Command/command.twig b/templates/bake/Command/command.twig index fe126f6c..cae42157 100644 --- a/templates/bake/Command/command.twig +++ b/templates/bake/Command/command.twig @@ -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; } } diff --git a/tests/comparisons/Command/testBakePlugin.php b/tests/comparisons/Command/testBakePlugin.php index c762139d..0486b07d 100644 --- a/tests/comparisons/Command/testBakePlugin.php +++ b/tests/comparisons/Command/testBakePlugin.php @@ -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; } }