Conditions | 7 |
Paths | 4 |
Total Lines | 9 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 7 |
Changes | 0 |
1 | <?php |
||
37 | 1 | public static function build($callable) { |
|
38 | 1 | if (is_array($callable) && count($callable) == 2 && is_object($callable[0])) { |
|
39 | 1 | return new static($callable); |
|
40 | 1 | } elseif (is_string($callable) && function_exists($callable)) { |
|
41 | 1 | return new static($callable); |
|
42 | 1 | } elseif (is_callable($callable)) { |
|
43 | 1 | return new static($callable); |
|
44 | } else { |
||
45 | 1 | return new static(null); |
|
46 | } |
||
54 |