Total Complexity | 3 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | abstract class AbstractCommand extends Command |
||
16 | { |
||
17 | abstract protected function doExecute(InputInterface $input, ResponseInterface $response): void; |
||
18 | |||
19 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
20 | { |
||
21 | $this->validateInput($input); |
||
22 | $symfonyStyle = new SymfonyStyle($input, $output); |
||
23 | try { |
||
24 | $memory = memory_get_usage(); |
||
25 | $start = microtime(true); |
||
26 | $this->doExecute($input, new ConsoleResponse($input, $output)); |
||
27 | $stop = number_format(microtime(true) - $start, 2); |
||
28 | |||
29 | $symfonyStyle->success( |
||
30 | sprintf('Process took %f seconds. Memory used %f bytes.', $stop, memory_get_usage() - $memory) |
||
31 | ); |
||
32 | |||
33 | return Command::SUCCESS; |
||
34 | } catch (Throwable $exception) { |
||
35 | $symfonyStyle->error($exception->getMessage()); |
||
36 | |||
37 | return Command::FAILURE; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | protected function validateInput(InputInterface $input): void |
||
43 | } |
||
44 | } |
||
45 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths