| Conditions | 5 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 28 | function path_match(string $path, string $subject, &$attributes = []) : bool |
||
| 29 | { |
||
| 30 | $regex = path_regex($path); |
||
| 31 | if (!preg_match($regex, $subject, $matches)) { |
||
| 32 | return false; |
||
| 33 | } |
||
| 34 | |||
| 35 | $attributes = []; |
||
| 36 | foreach ($matches as $key => $value) { |
||
| 37 | if (!is_int($key) && '' !== $value) { |
||
| 38 | $attributes[$key] = $value; |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | return true; |
||
| 43 | } |
||
| 44 |