Conditions | 5 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | public static function init($strings) |
||
42 | { |
||
43 | if (is_null($strings)) { |
||
44 | return null; |
||
45 | } |
||
46 | |||
47 | if (self::isString($strings)) { |
||
48 | return new static([$strings]); |
||
49 | } |
||
50 | |||
51 | if (is_array($strings)){ |
||
52 | if(empty($strings)){ |
||
53 | return null; |
||
54 | } |
||
55 | |||
56 | return new self($strings); |
||
57 | } |
||
58 | |||
59 | throw new InvalidArgumentException('Argument must be string or string list, ' . gettype($strings) . ' received'); |
||
60 | } |
||
61 | |||
76 | } |