From: Jefersson Nathan Date: Fri, 23 Dec 2016 14:39:03 +0000 (-0300) Subject: use strong comparators X-Git-Tag: 1.2.0-alpha~5^2~2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=00797c74dbe2fa4559115b0ed5cb98979e108d30;hp=127e54e096a3b525befaa81d02c58b41d17fcc22;p=php-libraries%2FRouter.git use strong comparators --- diff --git a/src/Router.php b/src/Router.php index 11d44bf..4d68044 100755 --- a/src/Router.php +++ b/src/Router.php @@ -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; }