diff --git a/Console/Command/ConfigGetCommand.php b/Console/Command/ConfigGetCommand.php index 1071149c..4d8b87f8 100644 --- a/Console/Command/ConfigGetCommand.php +++ b/Console/Command/ConfigGetCommand.php @@ -27,6 +27,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputOption; +use Magento\Framework\Console\Cli; /** * Class ConfigGetCommand @@ -189,7 +190,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c if (count(array_unique($options)) === 1) { $this->output->writeln('' . $this->getSynopsis() . '', OutputInterface::OUTPUT_NORMAL); - return; + return Cli::RETURN_FAILURE; } // Get Service ID @@ -261,6 +262,8 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c if ($input->getOption('fastly-status')) { $this->getFastlyStatus($this->config->isFastlyEnabled()); } + + return Cli::RETURN_SUCCESS; } /** diff --git a/Console/Command/ConfigImportCommand.php b/Console/Command/ConfigImportCommand.php index 0c8c836d..fad7e15a 100644 --- a/Console/Command/ConfigImportCommand.php +++ b/Console/Command/ConfigImportCommand.php @@ -25,6 +25,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputOption; +use Magento\Framework\Console\Cli; /** * Class ConfigImportCommand @@ -93,7 +94,8 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c $data = json_decode(file_get_contents($file)); if (!$data) { $output->writeln("Invalid file structure"); - return; + + return Cli::RETURN_FAILURE; } $clone = $this->getClonedVersion(); @@ -117,7 +119,10 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c } catch (\Exception $e) { $output->writeln("{$e->getMessage()}"); + return Cli::RETURN_FAILURE; } + + return Cli::RETURN_SUCCESS; } /** diff --git a/Console/Command/EnableCommand.php b/Console/Command/EnableCommand.php index 259d999d..caa9f24d 100644 --- a/Console/Command/EnableCommand.php +++ b/Console/Command/EnableCommand.php @@ -30,6 +30,7 @@ use Symfony\Component\Console\Input\InputOption; use Magento\Framework\App\Config\Storage\WriterInterface; use Magento\Framework\App\Cache\Manager; +use Magento\Framework\Console\Cli; use Magento\Framework\Filesystem; use Magento\Framework\App\Filesystem\DirectoryList; @@ -284,7 +285,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c if (count(array_unique($options)) === 1) { $this->output->writeln('' . $this->getSynopsis() . '', OutputInterface::OUTPUT_NORMAL); - return; + return Cli::RETURN_FAILURE; } // Set Service ID @@ -389,6 +390,8 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c $arguments = new ArrayInput(['command' => 'cache:flush', 'types' => ['config']]); $this->getApplication()->find('cache:flush')->run($arguments, $output); + + return Cli::RETURN_SUCCESS; } /** diff --git a/Console/Command/GenerateVclCommand.php b/Console/Command/GenerateVclCommand.php index 8a9455f4..8d82a60f 100644 --- a/Console/Command/GenerateVclCommand.php +++ b/Console/Command/GenerateVclCommand.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Magento\Framework\Console\Cli; /** * Class GenerateVclCommand @@ -51,5 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c "Fastly custom VCL use been deprecated." . "Please upload VCL snippets from the Magento admin UI or using the CLI commands." ); + + return Cli::RETURN_SUCCESS; } } diff --git a/Console/Command/JsonToSerialize.php b/Console/Command/JsonToSerialize.php index 5214e06e..f54f12bf 100644 --- a/Console/Command/JsonToSerialize.php +++ b/Console/Command/JsonToSerialize.php @@ -24,6 +24,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Config\Storage\WriterInterface; use Magento\Framework\App\ProductMetadataInterface; +use Magento\Framework\Console\Cli; use Magento\Framework\Serialize\SerializerInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; @@ -120,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c if ($oldData === false || $oldData === null) { $output->writeln('Invalid JSON format, unable to decode config data : ' . $path); - return; + return Cli::RETURN_FAILURE; } $oldData = (is_array($oldData)) ? $oldData : []; @@ -134,6 +135,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c $this->cacheManager->clean([\Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER]); $output->writeln('Config Cache Flushed'); + return Cli::RETURN_SUCCESS; } } } diff --git a/Console/Command/SerializeToJson.php b/Console/Command/SerializeToJson.php index fc18e5ca..a046947e 100644 --- a/Console/Command/SerializeToJson.php +++ b/Console/Command/SerializeToJson.php @@ -24,6 +24,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Config\Storage\WriterInterface; use Magento\Framework\App\ProductMetadataInterface; +use Magento\Framework\Console\Cli; use Magento\Framework\Serialize\Serializer\Serialize; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; @@ -130,7 +131,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c 'Invalid serialization format, unable to unserialize config data : ' . $path ); - return; + return Cli::RETURN_FAILURE; } $oldData = (is_array($oldData)) ? $oldData : []; @@ -143,6 +144,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c $this->cacheManager->clean([\Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER]); $output->writeln('Config Cache Flushed'); + return Cli::RETURN_SUCCESS; } } } diff --git a/Console/Command/SuperUserCommand.php b/Console/Command/SuperUserCommand.php index a98c7733..6a4d5ef8 100644 --- a/Console/Command/SuperUserCommand.php +++ b/Console/Command/SuperUserCommand.php @@ -23,6 +23,7 @@ use Fastly\Cdn\Model\Config; use Fastly\Cdn\Model\Api; use Fastly\Cdn\Helper\Vcl; +use Magento\Framework\Console\Cli; use Magento\Framework\Filesystem; use Magento\Framework\App\Filesystem\DirectoryList; use Symfony\Component\Console\Command\Command; @@ -119,7 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c if (count(array_unique($options)) === 1) { $this->output->writeln('' . $this->getSynopsis() . '', OutputInterface::OUTPUT_NORMAL); - return; + return Cli::RETURN_FAILURE; } if ($input->getOption('enable')) { @@ -133,6 +134,8 @@ protected function execute(InputInterface $input, OutputInterface $output) // @c if ($input->getOption('update')) { $this->updateSuIps(); } + + return Cli::RETURN_SUCCESS; } /**