Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
43 | 2 | private function buildRegex(array $packages): array |
|
44 | 2 | { |
|
45 | 2 | $groups = []; |
|
46 | 2 | ||
47 | foreach ($packages as $package => $directory) { |
||
48 | [$prefix, $bundle] = explode('/', $package); |
||
49 | $groups[sprintf('(?i:%s)(?|', $prefix)][] = sprintf( |
||
50 | 2 | '/?(?i:%s) (*MARK:%s)|', |
|
51 | str_replace('-', '-?', $bundle), |
||
52 | $directory |
||
53 | ); |
||
54 | } |
||
55 | |||
56 | return $groups; |
||
57 | } |
||
59 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: