| Conditions | 3 |
| Paths | 4 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3.0327 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 8 | public static function createProcess($task): Runnable |
|
| 30 | { |
||
| 31 | 8 | if (!self::$isInitialised) { |
|
| 32 | self::init(); |
||
| 33 | } |
||
| 34 | |||
| 35 | 8 | list($task, $appConfigFile) = $task; |
|
| 36 | |||
| 37 | 8 | if (!Pool::isSupported()) { |
|
| 38 | return SynchronousProcess::create($task, self::getId()); |
||
| 39 | } |
||
| 40 | |||
| 41 | 8 | $process = new Process(implode(' ', [ |
|
|
|
|||
| 42 | 8 | 'exec php', |
|
| 43 | 8 | self::$childProcessScript, |
|
| 44 | 8 | self::$autoloader, |
|
| 45 | 8 | self::encodeTask($task), |
|
| 46 | 8 | $appConfigFile |
|
| 47 | ])); |
||
| 48 | |||
| 49 | 8 | return ParallelProcess::create($process, self::getId()); |
|
| 50 | } |
||
| 51 | } |
||
| 52 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: