| Conditions | 5 |
| Paths | 9 |
| Total Lines | 52 |
| Code Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 51 | public function execute(InputInterface $input, OutputInterface $output): int |
||
| 52 | { |
||
| 53 | $application = $this->getApplication(); |
||
| 54 | if (null === $application) { |
||
| 55 | throw new InvalidArgumentException('The Doctrine Application is undefined'); |
||
| 56 | } |
||
| 57 | $output->writeln('Executing database rebuild commands'); |
||
| 58 | |||
| 59 | $autoExit = $application->isAutoExitEnabled(); |
||
| 60 | $application->setAutoExit(false); |
||
| 61 | $application->setCatchExceptions(false); |
||
| 62 | |||
| 63 | if (!$input->getOption('disable-drop')) { |
||
| 64 | $output->writeln('Executing orm:schema:tool:drop'); |
||
| 65 | |||
| 66 | $commandArguments = [ |
||
| 67 | 'command' => 'orm:schema-tool:drop', |
||
| 68 | '--force' => true, |
||
| 69 | ]; |
||
| 70 | $application->run(new ArrayInput($commandArguments)); |
||
| 71 | } |
||
| 72 | |||
| 73 | $output->writeln('Executing orm:schema:tool:update'); |
||
| 74 | $commandArguments = [ |
||
| 75 | 'command' => 'orm:schema-tool:create', |
||
| 76 | ]; |
||
| 77 | |||
| 78 | $application->run(new ArrayInput($commandArguments)); |
||
| 79 | |||
| 80 | if (!$input->getOption('disable-update')) { |
||
| 81 | $output->writeln('Executing orm:schema:tool:update'); |
||
| 82 | |||
| 83 | $commandArguments = [ |
||
| 84 | 'command' => 'orm:schema-tool:update', |
||
| 85 | '--force' => true, |
||
| 86 | ]; |
||
| 87 | $application->run(new ArrayInput($commandArguments)); |
||
| 88 | } |
||
| 89 | |||
| 90 | if (!$input->getOption('disable-import')) { |
||
| 91 | $output->writeln('Executing data-fixture:import'); |
||
| 92 | |||
| 93 | $commandArguments = [ |
||
| 94 | 'command' => 'data-fixture:import', |
||
| 95 | '--append' => true, |
||
| 96 | ]; |
||
| 97 | $application->run(new ArrayInput($commandArguments)); |
||
| 98 | } |
||
| 99 | |||
| 100 | $application->setAutoExit($autoExit); |
||
| 101 | $output->writeln('Rebuild completed successfully'); |
||
| 102 | return 0; |
||
| 103 | } |
||
| 105 |
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