hanneskod /
readme-tester
| 1 | <?php |
||||
| 2 | |||||
| 3 | declare(strict_types=1); |
||||
| 4 | |||||
| 5 | namespace hanneskod\readmetester\Runner; |
||||
| 6 | |||||
| 7 | use hanneskod\readmetester\Attribute\Isolate; |
||||
| 8 | use hanneskod\readmetester\Example\ExampleObj; |
||||
|
0 ignored issues
–
show
|
|||||
| 9 | use hanneskod\readmetester\Example\ExampleStoreInterface; |
||||
| 10 | |||||
| 11 | use function Amp\Promise\wait; |
||||
| 12 | use function Amp\ParallelFunctions\parallelMap; |
||||
| 13 | |||||
| 14 | final class ParallelRunner implements RunnerInterface |
||||
| 15 | { |
||||
| 16 | private string $bootstrap = ''; |
||||
| 17 | |||||
| 18 | public function setBootstrap(string $filename): void |
||||
| 19 | { |
||||
| 20 | $this->bootstrap = $filename; |
||||
| 21 | } |
||||
| 22 | |||||
| 23 | public function run(ExampleStoreInterface $exampleStore): iterable |
||||
| 24 | { |
||||
| 25 | $examples = $exampleStore->getExamples(); |
||||
| 26 | |||||
| 27 | if ($examples instanceof \Traversable) { |
||||
| 28 | $examples = iterator_to_array($examples, false); |
||||
| 29 | } |
||||
| 30 | |||||
| 31 | // @phpstan-ignore-next-line |
||||
| 32 | return wait( |
||||
| 33 | parallelMap( |
||||
| 34 | $examples, |
||||
|
0 ignored issues
–
show
It seems like
$examples can also be of type iterable; however, parameter $array of Amp\ParallelFunctions\parallelMap() does only seem to accept array, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 35 | function (ExampleObj $example): OutcomeInterface { |
||||
| 36 | $runner = new EvalRunner(); |
||||
| 37 | $runner->setBootstrap($this->bootstrap); |
||||
| 38 | return $runner->runExample($example); |
||||
| 39 | } |
||||
| 40 | ) |
||||
| 41 | ); |
||||
| 42 | } |
||||
| 43 | } |
||||
| 44 |
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