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