OSDN Git Service

use strong comparators
authorJefersson Nathan <admin@phpse.net>
Fri, 23 Dec 2016 14:39:03 +0000 (11:39 -0300)
committerJefersson Nathan <admin@phpse.net>
Fri, 23 Dec 2016 14:39:03 +0000 (11:39 -0300)
src/Router.php

index 11d44bf..4d68044 100755 (executable)
@@ -103,12 +103,12 @@ class Router
     {
         foreach ($this->routes->all() as $routes) {
             // compare server request method with route's allowed http methods
-            if (!in_array($requestMethod, (array)$routes->getMethods())) {
+            if (! in_array($requestMethod, (array)$routes->getMethods(), true)) {
                 continue;
             }
 
             $currentDir = dirname($_SERVER['SCRIPT_NAME']);
-            if ($currentDir != '/') {
+            if ('/' !== $currentDir) {
                 $requestUrl = str_replace($currentDir, '', $requestUrl);
             }
 
@@ -126,7 +126,7 @@ class Router
                 $argument_keys = $argument_keys[1];
 
                 // check arguments number
-                if(count($argument_keys) != count($matches)) {
+                if(count($argument_keys) !== count($matches)) {
                     continue;
                 }