| Conditions | 5 | 
| Paths | 2 | 
| Total Lines | 68 | 
| Code Lines | 42 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 4 | ||
| Bugs | 0 | Features | 1 | 
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 | ||
| 111 | public function execute(InputInterface $input, OutputInterface $output): int | ||
| 112 |     { | ||
| 113 | $target_php_settings = TargetPhpSettings::fromConsoleInput($input); | ||
| 114 | $loop_settings = TraceLoopSettings::fromConsoleInput($input); | ||
| 115 | $get_trace_settings = GetTraceSettings::fromConsoleInput($input); | ||
| 116 | $daemon_settings = DaemonSettings::fromConsoleInput($input); | ||
| 117 | |||
| 118 | $searcher_context = $this->php_searcher_context_creator->create(); | ||
| 119 | Promise\wait($searcher_context->start()); | ||
| 120 | Promise\wait($searcher_context->sendTargetRegex($daemon_settings->target_regex)); | ||
| 121 | $pid_list = Promise\wait($searcher_context->receivePidList()); | ||
| 122 | |||
| 123 | $readers = []; | ||
| 124 |         foreach ($pid_list as $target_pid) { | ||
| 125 | $reader_context = $this->php_reader_context_creator->create(); | ||
| 126 | Promise\wait($reader_context->start()); | ||
| 127 | Promise\wait( | ||
| 128 | $reader_context->sendSettings( | ||
| 129 | [ | ||
| 130 | $target_pid, | ||
| 131 | $target_php_settings, | ||
| 132 | $loop_settings, | ||
| 133 | $get_trace_settings | ||
| 134 | ] | ||
| 135 | ) | ||
| 136 | ); | ||
| 137 | $readers[$target_pid] = $reader_context; | ||
| 138 | } | ||
| 139 |         exec('stty -icanon -echo'); | ||
| 140 | |||
| 141 |         Loop::run(function () use (&$readers, $output) { | ||
| 142 | Loop::onReadable( | ||
| 143 | STDIN, | ||
| 144 | /** @param resource $stream */ | ||
| 145 |                 function (string $watcher_id, $stream) { | ||
| 146 | $key = fread($stream, 1); | ||
| 147 |                     if ($key === 'q') { | ||
| 148 | Loop::cancel($watcher_id); | ||
| 149 | Loop::stop(); | ||
| 150 | } | ||
| 151 | } | ||
| 152 | ); | ||
| 153 |             Loop::repeat(10, function () use (&$readers, $output) { | ||
| 154 | /** @var array<int, PhpReaderContext> $readers */ | ||
| 155 | |||
| 156 | $promises = []; | ||
| 157 |                 foreach ($readers as $pid => $reader) { | ||
| 158 |                     if (!$reader->isRunning()) { | ||
| 159 | /** @psalm-suppress MixedArrayAccess*/ | ||
| 160 | unset($readers[$pid]); | ||
| 161 | continue; | ||
| 162 | } | ||
| 163 | $promises[] = \Amp\call( | ||
| 164 |                         function () use ($reader, &$readers, $pid, $output) { | ||
| 165 | /** @psalm-suppress MixedArrayAccess*/ | ||
| 166 | unset($readers[$pid]); | ||
| 167 | /** @var string $result */ | ||
| 168 | $result = yield $reader->receiveTrace(); | ||
| 169 | $output->write($result); | ||
| 170 | $readers[$pid] = $reader; | ||
| 171 | } | ||
| 172 | ); | ||
| 173 | } | ||
| 174 | yield $promises; | ||
| 175 | }); | ||
| 176 | }); | ||
| 177 | |||
| 178 | return 0; | ||
| 179 | } | ||
| 181 | 
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