Conditions | 4 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
27 | 3 | public function split( |
|
28 | $pattern, |
||
29 | $string, |
||
30 | $limit = -1, |
||
31 | $returnOnlyNotEmpty = false, |
||
32 | $captureOffset = false, |
||
33 | $captureSubpatterns = false |
||
34 | ) { |
||
35 | 3 | $result = @preg_split( |
|
36 | 3 | $this->getPatternByType($pattern), |
|
37 | 3 | $string, |
|
38 | 3 | $limit, |
|
39 | 3 | ($returnOnlyNotEmpty ? PREG_SPLIT_NO_EMPTY : 0) |
|
40 | 3 | | ($captureOffset ? PREG_SPLIT_OFFSET_CAPTURE : 0) |
|
41 | 3 | | ($captureSubpatterns ? PREG_SPLIT_DELIM_CAPTURE : 0) |
|
42 | ); |
||
43 | 3 | $this->checkResultIsOkOrThrowException($result, $pattern); |
|
44 | |||
45 | 2 | return $result; |
|
46 | } |
||
47 | |||
63 |