| Total Complexity | 3 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | final class SampleURIGenerator |
||
| 21 | { |
||
| 22 | private RouteCollection $routes; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Exemple de chemin URI pour l'espace réservé. |
||
| 26 | * |
||
| 27 | * @var array<string, string> |
||
| 28 | */ |
||
| 29 | private array $samples = [ |
||
| 30 | 'any' => '123/abc', |
||
| 31 | 'segment' => 'abc_123', |
||
| 32 | 'alphanum' => 'abc123', |
||
| 33 | 'num' => '123', |
||
| 34 | 'alpha' => 'abc', |
||
| 35 | 'hash' => 'abc_123', |
||
| 36 | ]; |
||
| 37 | |||
| 38 | public function __construct(?RouteCollection $routes = null) |
||
| 39 | { |
||
| 40 | $this->routes = $routes ?? Services::routes(); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $routeKey clé de routage regex |
||
| 45 | * |
||
| 46 | * @return string exemple de chemin URI |
||
| 47 | */ |
||
| 48 | public function get(string $routeKey): string |
||
| 60 | } |
||
| 61 | } |
||
| 62 |