| Conditions | 4 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function locate(Pattern $pattern) |
||
| 27 | { |
||
| 28 | $root = $pattern->getFixedPart(); |
||
| 29 | // todo: quick hack instead of proper solution |
||
| 30 | if ($pattern->isFixed()) { |
||
| 31 | $root = dirname($root); |
||
| 32 | } |
||
| 33 | $entries = []; |
||
| 34 | foreach ($this->filesystem->listContents($root, true) as $entry) { |
||
| 35 | if (!$pattern->matches($entry['path'])) { |
||
| 36 | continue; |
||
| 37 | } |
||
| 38 | $entry['parameters'] = $pattern->getParameters($entry['path']); |
||
| 39 | $entries[] = $entry; |
||
| 40 | } |
||
| 41 | return $entries; |
||
| 42 | } |
||
| 44 |