| 1 | <?php declare(strict_types = 1); |
||
| 13 | class RoutePathProcessor implements RoutePathProcessorContract |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string[] |
||
| 18 | */ |
||
| 19 | private $patterns = ['/{\?(.+?)}/' => '[{$1}]']; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @inheritDoc |
||
| 23 | */ |
||
| 24 | 2 | public function addPattern(string $placeholder, string $regex): RoutePathProcessorContract |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @inheritDoc |
||
| 33 | */ |
||
| 34 | 2 | public function process(RouteContract $route): RouteContract |
|
| 40 | |||
| 41 | |||
| 42 | } |
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.