Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.3332 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 1 | private function createProcess($payload): Process |
|
18 | { |
||
19 | 1 | if ($payload instanceof Process) { |
|
20 | return $payload; |
||
21 | } |
||
22 | |||
23 | 1 | if (is_string($payload)) { |
|
24 | 1 | return new Process($payload); |
|
|
|||
25 | } |
||
26 | |||
27 | throw BadPayloadException::unexpectedType($payload, 'string or '.Process::class, __CLASS__); |
||
28 | } |
||
30 |