Conditions | 4 |
Paths | 5 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
47 | $path = array_slice($paths, 3); |
||
48 | array_walk($path, [$this, 'camel2kebab']); |
||
49 | if ($scheme === '*') { |
||
50 | $uri = sprintf('%s://self/%s', $path[0], implode('/', array_slice($path, 1))); |
||
51 | |||
52 | yield new ResMeta($uri, $class, $file); |
||
53 | } |
||
54 | if ($scheme === $path[0]) { |
||
55 | $uri = sprintf('/%s', implode('/', array_slice($path, 1))); |
||
56 | |||
57 | yield new ResMeta($uri, $class, $file); |
||
58 | } |
||
59 | } |
||
60 | } |
||
61 | |||
62 | private function camel2kebab(string &$str) |
||
63 | { |
||
64 | $str = ltrim(strtolower((string) preg_replace('/[A-Z]/', '-\0', $str)), '-'); |
||
65 | } |
||
67 |