| Conditions | 3 |
| Paths | 4 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public static function createProcess($task, ?int $outputLength = null, ?string $binary = 'php'): Runnable |
||
| 29 | { |
||
| 30 | if (! self::$isInitialised) { |
||
| 31 | self::init(); |
||
| 32 | } |
||
| 33 | |||
| 34 | if (! Pool::isSupported()) { |
||
| 35 | return new SynchronousProcess($task, self::getId()); |
||
| 36 | } |
||
| 37 | |||
| 38 | $process = new Process([ |
||
| 39 | $binary, |
||
| 40 | self::$childProcessScript, |
||
| 41 | self::$autoloader, |
||
| 42 | self::encodeTask($task), |
||
| 43 | $outputLength, |
||
| 44 | base_path(), |
||
| 45 | ]); |
||
| 46 | |||
| 47 | return new ParallelProcess($process, self::getId()); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |