@@ -22,7 +22,7 @@ class Router
2222 protected $ errorCallback ;
2323 protected $ patterns = [
2424 '{a} ' => '([^/]+) ' ,
25- '{i } ' => '([0-9]+) ' ,
25+ '{d } ' => '([0-9]+) ' ,
2626 '{s} ' => '([a-zA-Z]+) ' ,
2727 '{u} ' => '([a-zA-Z0-9_-]+) ' ,
2828 '{*} ' => '(.*) '
@@ -111,14 +111,14 @@ public function pattern($pattern, $attr = null)
111111 if (!in_array ('{ ' . $ key . '} ' , array_keys ($ this ->patterns )))
112112 $ this ->patterns ['{ ' . $ key . '} ' ] = '( ' . $ value . ') ' ;
113113 else
114- $ this ->message ('Opps! Error :( ' , '<b> ' . $ key . '</b> filter cannot be changed. ' );
114+ $ this ->message ('Opps! Error :( ' , '<b> ' . $ key . '</b> pattern cannot be changed. ' );
115115 }
116116 else
117117 {
118118 if (!in_array ('{ ' . $ pattern . '} ' , array_keys ($ this ->patterns )))
119119 $ this ->patterns ['{ ' . $ pattern . '} ' ] = '( ' . $ attr . ') ' ;
120120 else
121- $ this ->message ('<h2>Opps! Error :( ' , '<b> ' . $ pattern . '</b> filter cannot be changed. ' );
121+ $ this ->message ('<h2>Opps! Error :( ' , '<b> ' . $ pattern . '</b> pattern cannot be changed. ' );
122122 }
123123
124124 return ;
@@ -324,19 +324,19 @@ public function controller($route, $controller)
324324 if (!class_exists ($ controller ))
325325 $ req = require_once ($ controllerFile );
326326
327- $ class_methods = get_class_methods ($ controller );
327+ $ classMethods = get_class_methods ($ controller );
328328
329- foreach ($ class_methods as $ method_name )
329+ foreach ($ classMethods as $ methodName )
330330 {
331- if (!strstr ($ method_name , '__ ' ))
331+ if (!strstr ($ methodName , '__ ' ))
332332 {
333- $ r = new \ReflectionMethod ($ controller , $ method_name );
333+ $ r = new \ReflectionMethod ($ controller , $ methodName );
334334 $ param_num = $ r ->getNumberOfRequiredParameters ();
335335 $ param_num2 = $ r ->getNumberOfParameters ();
336336
337- $ value = ($ method_name == 'main ' ? $ route : $ route . '/ ' . $ method_name );
337+ $ value = ($ methodName == 'main ' ? $ route : $ route . '/ ' . $ methodName );
338338
339- $ this ->any (($ value . str_repeat ('/{a} ' , $ param_num ) . str_repeat ('/{a?} ' , $ param_num2 - $ param_num )), ($ controller . '@ ' . $ method_name ));
339+ $ this ->any (($ value . str_repeat ('/{a} ' , $ param_num ) . str_repeat ('/{a?} ' , $ param_num2 - $ param_num )), ($ controller . '@ ' . $ methodName ));
340340 }
341341 }
342342
0 commit comments