1313
1414
1515/**
16- * The bidirectional route is responsible for mapping
17- * HTTP request to an array for dispatch and vice-versa.
16+ * Bidirectional route mapping between HTTP requests and parameter arrays using a URL mask.
1817 */
1918class Route implements Router
2019{
@@ -107,9 +106,6 @@ public function __construct(string $mask, array $metadata = [])
107106 }
108107
109108
110- /**
111- * Returns mask.
112- */
113109 public function getMask (): string
114110 {
115111 return $ this ->mask ;
@@ -126,10 +122,7 @@ protected function getMetadata(): array
126122 }
127123
128124
129- /**
130- * Returns default values.
131- * @return array<string, mixed>
132- */
125+ /** @return array<string, mixed> */
133126 public function getDefaults (): array
134127 {
135128 $ defaults = [];
@@ -144,6 +137,7 @@ public function getDefaults(): array
144137
145138
146139 /**
140+ * Returns parameters that must have a specific fixed value for the route to match.
147141 * @internal
148142 * @return array<string, mixed>
149143 */
@@ -160,10 +154,7 @@ public function getConstantParameters(): array
160154 }
161155
162156
163- /**
164- * Maps HTTP request to an array.
165- * @return ?array<string, mixed>
166- */
157+ /** @return ?array<string, mixed> */
167158 public function match (Nette \Http \IRequest $ httpRequest ): ?array
168159 {
169160 // combine with precedence: mask (params in URL-path), fixity, query, (post,) defaults
@@ -258,10 +249,7 @@ public function match(Nette\Http\IRequest $httpRequest): ?array
258249 }
259250
260251
261- /**
262- * Constructs absolute URL from array.
263- * @param array<string, mixed> $params
264- */
252+ /** @param array<string, mixed> $params */
265253 public function constructUrl (array $ params , Nette \Http \UrlScript $ refUrl ): ?string
266254 {
267255 if (!$ this ->preprocessParams ($ params )) {
@@ -620,7 +608,7 @@ private function parseQuery(array $parts): bool
620608
621609
622610 /**
623- * Rename keys in array.
611+ * Renames keys in array according to the translation table .
624612 * @param array<string, mixed> $arr
625613 * @param array<string, string> $xlat
626614 * @return array<string, mixed>
@@ -647,7 +635,7 @@ private static function renameKeys(array $arr, array $xlat): array
647635
648636
649637 /**
650- * Url encode .
638+ * Encodes a parameter value for use in a URL path segment, leaving allowed characters unencoded .
651639 */
652640 public static function param2path (string $ s ): string
653641 {
0 commit comments