Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
36 | private function buildRegex($packages): array |
||
37 | { |
||
38 | $groups = []; |
||
39 | |||
40 | foreach ($packages as $package) { |
||
41 | [$prefix, $bundle] = explode('/', $package['name']); |
||
42 | $groups[sprintf('(?i:%s)(?|', $prefix)][] = sprintf('/?(?i:%s) (*MARK:%s)|', str_replace('-', '-?', $bundle), $package['name']); |
||
43 | } |
||
44 | |||
45 | return $groups; |
||
46 | } |
||
48 |