| Conditions | 8 |
| Paths | 40 |
| Total Lines | 63 |
| Code Lines | 38 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 |
||
| 60 | public function run() |
||
| 61 | { |
||
| 62 | $this->application->setAutoExit(false); |
||
| 63 | $this->application->setCatchExceptions(true); |
||
| 64 | |||
| 65 | if ($this->hasReadline) { |
||
| 66 | readline_read_history($this->history); |
||
| 67 | readline_completion_function(array($this, 'autocompleter')); |
||
| 68 | } |
||
| 69 | |||
| 70 | $this->output->writeln($this->getHeader()); |
||
| 71 | $php = null; |
||
| 72 | if ($this->processIsolation) { |
||
| 73 | $finder = new PhpExecutableFinder(); |
||
| 74 | $php = $finder->find(); |
||
| 75 | $this->output->writeln( |
||
| 76 | <<<'EOF' |
||
| 77 | <info>Running with process isolation, you should consider this:</info> |
||
| 78 | * each command is executed as separate process, |
||
| 79 | * commands don't support interactivity, all params must be passed explicitly, |
||
| 80 | * commands output is not colorized. |
||
| 81 | |||
| 82 | EOF |
||
| 83 | ); |
||
| 84 | } |
||
| 85 | |||
| 86 | while (true) { |
||
| 87 | $command = $this->readline(); |
||
| 88 | |||
| 89 | if (false === $command) { |
||
| 90 | $this->output->writeln("\n"); |
||
| 91 | |||
| 92 | break; |
||
| 93 | } |
||
| 94 | |||
| 95 | if ($this->hasReadline) { |
||
| 96 | readline_add_history($command); |
||
| 97 | readline_write_history($this->history); |
||
| 98 | } |
||
| 99 | |||
| 100 | if ($this->processIsolation) { |
||
| 101 | $pb = new ProcessBuilder(); |
||
| 102 | |||
| 103 | $process = $pb |
||
| 104 | ->add($php) |
||
| 105 | ->add($_SERVER['argv'][0]) |
||
| 106 | ->add($command) |
||
| 107 | ->inheritEnvironmentVariables(true) |
||
| 108 | ->getProcess() |
||
| 109 | ; |
||
| 110 | |||
| 111 | $output = $this->output; |
||
| 112 | $process->run(function ($type, $data) use ($output) { |
||
| 113 | $output->writeln($data); |
||
| 114 | }); |
||
| 115 | |||
| 116 | $ret = $process->getExitCode(); |
||
| 117 | } else { |
||
| 118 | $ret = $this->application->run(new StringInput($command), $this->output); |
||
| 119 | } |
||
| 120 | |||
| 121 | if (0 !== $ret) { |
||
| 122 | $this->output->writeln(sprintf('<error>The command terminated with an error status (%s)</error>', $ret)); |
||
| 123 | } |
||
| 230 |
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