diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-17 10:09:03 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-17 10:09:03 -0400 |
commit | 8c532efd5f02f7a7e5ea322a07ddcf49d130a8ec (patch) | |
tree | 289222e21420b8d0092f06de097090f179202f6b /app/Core/Router.php | |
parent | b40190ee9fd557d86e594208ed77fa762c7dcfb7 (diff) |
Run php-cs-fixer on the code base
Diffstat (limited to 'app/Core/Router.php')
-rw-r--r-- | app/Core/Router.php | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/Core/Router.php b/app/Core/Router.php index 8f366daf..f4453c71 100644 --- a/app/Core/Router.php +++ b/app/Core/Router.php @@ -127,17 +127,13 @@ class Router extends Base $count = count($parts); foreach ($this->paths as $route) { - if ($count === $route['count']) { - $params = array(); for ($i = 0; $i < $count; $i++) { - if ($route['pattern'][$i]{0} === ':') { $params[substr($route['pattern'][$i], 1)] = $parts[$i]; - } - else if ($route['pattern'][$i] !== $parts[$i]) { + } elseif ($route['pattern'][$i] !== $parts[$i]) { break; } } @@ -168,7 +164,6 @@ class Router extends Base } foreach ($this->urls[$controller][$action] as $pattern) { - if (array_diff_key($params, $pattern['params']) === array()) { $url = $pattern['path']; $i = 0; @@ -213,8 +208,7 @@ class Router extends Base $this->controller = $this->sanitize($_GET['controller'], 'app'); $this->action = $this->sanitize($_GET['action'], 'index'); $plugin = ! empty($_GET['plugin']) ? $this->sanitize($_GET['plugin'], '') : ''; - } - else { + } else { list($this->controller, $this->action) = $this->findRoute($this->getPath($uri, $query_string)); // TODO: add plugin for routes $plugin = ''; } |