File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ final class Route {
49
49
*/
50
50
public function __construct (String $ method , String $ pattern , $ callback ) {
51
51
$ this ->method = $ this ->validateMethod (strtoupper ($ method ));
52
- $ this ->pattern = $ pattern ;
52
+ $ this ->pattern = cleanUrl ( $ pattern) ;
53
53
$ this ->callback = $ callback ;
54
54
}
55
55
@@ -60,7 +60,7 @@ private function validateMethod(string $method) {
60
60
if (in_array (strtoupper ($ method ), $ this ->list_method ))
61
61
return $ method ;
62
62
63
- throw new Exception ('Invalid Method Name ' );
63
+ throw new Exception ('Invalid Method Name ' );
64
64
}
65
65
66
66
/**
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ private function getMatchRoutersByRequestMethod() {
118
118
private function getMatchRoutersByPattern ($ pattern ) {
119
119
$ this ->matchRouter = [];
120
120
foreach ($ pattern as $ value ) {
121
- if ($ this ->dispatch ($ this ->url , $ value ->getPattern ()))
121
+ if ($ this ->dispatch (cleanUrl ( $ this ->url ) , $ value ->getPattern ()))
122
122
array_push ($ this ->matchRouter , $ value );
123
123
}
124
124
}
You can’t perform that action at this time.
0 commit comments