From 97b9a31dfacb778430348d31be84c03da47fdb69 Mon Sep 17 00:00:00 2001 From: Jesus Manuel Olivas Date: Mon, 12 Feb 2018 12:03:09 -0800 Subject: [PATCH] [debug:chain] Add warning message when no chain files found. (#310) --- src/Command/Debug/ChainCommand.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Command/Debug/ChainCommand.php b/src/Command/Debug/ChainCommand.php index 7506edb..1f399b1 100644 --- a/src/Command/Debug/ChainCommand.php +++ b/src/Command/Debug/ChainCommand.php @@ -56,6 +56,12 @@ protected function execute(InputInterface $input, OutputInterface $output) $files = $this->chainDiscovery->getFiles(); $filesPerDirectory = $this->chainDiscovery->getFilesPerDirectory(); + if (!$files || !$filesPerDirectory) { + $this->getIo()->warning($this->trans('commands.debug.chain.messages.no-files')); + + return 0; + } + foreach ($filesPerDirectory as $directory => $fileNames) { $this->getIo()->info(' ' . $this->trans('commands.debug.chain.messages.directory'), false); $this->getIo()->comment($directory);