| Total Complexity | 2 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | final class DefaultPatternRegistry implements RoutePatternRegistryInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var array<non-empty-string, non-empty-string> |
||
|
|
|||
| 9 | */ |
||
| 10 | private array $patterns = [ |
||
| 11 | 'int' => '\d+', |
||
| 12 | 'integer' => '\d+', |
||
| 13 | 'uuid' => '[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}', |
||
| 14 | ]; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param non-empty-string $name |
||
| 18 | * @param non-empty-string|\Stringable $pattern |
||
| 19 | */ |
||
| 20 | 1 | public function register(string $name, string|\Stringable $pattern): void |
|
| 21 | { |
||
| 22 | 1 | $this->patterns[$name] = (string)$pattern; |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return array<non-empty-string, non-empty-string> |
||
| 27 | */ |
||
| 28 | 3 | public function all(): array |
|
| 31 | } |
||
| 32 | } |
||
| 33 |