Skip to content

Commit f2d74dc

Browse files
committed
docs: fix $routes->match() HTTP verbs
1 parent 9f63491 commit f2d74dc

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

system/Router/RouteCollection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ public function presenter(string $name, ?array $options = null): RouteCollection
10011001
* Specifies a single route to match for multiple HTTP Verbs.
10021002
*
10031003
* Example:
1004-
* $route->match( ['get', 'post'], 'users/(:num)', 'users/$1);
1004+
* $route->match( ['GET', 'POST'], 'users/(:num)', 'users/$1);
10051005
*
10061006
* @param array|Closure|string $to
10071007
*/
@@ -1012,6 +1012,7 @@ public function match(array $verbs = [], string $from = '', $to = '', ?array $op
10121012
}
10131013

10141014
foreach ($verbs as $verb) {
1015+
// @TODO We should use correct uppercase verb.
10151016
$verb = strtolower($verb);
10161017

10171018
$this->{$verb}($from, $to, $options);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
$routes->match(['get', 'put'], 'products', 'Product::feature');
3+
$routes->match(['GET', 'PUT'], 'products', 'Product::feature');

user_guide_src/source/incoming/routing/033.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$routes->options('from', 'to', $options);
99
$routes->delete('from', 'to', $options);
1010
$routes->patch('from', 'to', $options);
11-
$routes->match(['get', 'put'], 'from', 'to', $options);
11+
$routes->match(['GET', 'PUT'], 'from', 'to', $options);
1212
$routes->resource('photos', $options);
1313
$routes->map($array, $options);
1414
$routes->group('name', $options, static function () {});

0 commit comments

Comments
 (0)