@@ -87,7 +87,9 @@ |
||
87 | 87 | |
88 | 88 | foreach ($this->routes as $handler) { |
89 | 89 | |
90 | - if(!$this->parser->methodMatch($handler[0], $requestMethod, $handler[1], $requestUrl)) continue; |
|
90 | + if(!$this->parser->methodMatch($handler[0], $requestMethod, $handler[1], $requestUrl)) { |
|
91 | + continue; |
|
92 | + } |
|
91 | 93 | |
92 | 94 | return array( |
93 | 95 | 'target' => $handler[2], |
@@ -84,15 +84,12 @@ |
||
84 | 84 | if(in_array($requestMethod, $methods)) { |
85 | 85 | if($routeString == '*') { |
86 | 86 | return true; |
87 | - } |
|
88 | - elseif(isset($routeString[0]) && $routeString[0] == '@') { |
|
87 | + } elseif(isset($routeString[0]) && $routeString[0] == '@') { |
|
89 | 88 | $match = preg_match('`' . substr($routeString, 1) . '`u', $requestUrl, $this->params); |
90 | 89 | return $match; |
91 | - } |
|
92 | - elseif (($position = strpos($routeString, '[')) === false) { |
|
90 | + } elseif (($position = strpos($routeString, '[')) === false) { |
|
93 | 91 | return strcmp($requestUrl, $routeString) === 0; |
94 | - } |
|
95 | - else { |
|
92 | + } else { |
|
96 | 93 | if (strncmp($requestUrl, $routeString, $position) !== 0) { |
97 | 94 | return false; |
98 | 95 | } |
@@ -36,8 +36,7 @@ |
||
36 | 36 | echo '<li>'.$k.': '.$v.'</li>'; |
37 | 37 | } |
38 | 38 | echo '</ul>'; |
39 | - } |
|
40 | - else { |
|
39 | + } else { |
|
41 | 40 | echo $value; |
42 | 41 | } |
43 | 42 | echo '</p>'; |