diff --git a/AltoRouter.php b/AltoRouter.php index fa9e451..d8ff998 100644 --- a/AltoRouter.php +++ b/AltoRouter.php @@ -49,13 +49,13 @@ class AltoRouter * @param array $matchTypes * @throws Exception */ - public function __construct(array $routes = [], $basePath = '', $matchTypes = []) + public function __construct(array $routes = [], $basePath = '', array $matchTypes = []) { $this->addRoutes($routes); $this->setBasePath($basePath); $this->addMatchTypes($matchTypes); } - + /** * Retrieves all routes. * Useful if you want to process or display routes. @@ -152,7 +152,7 @@ public function generate($routeName, array $params = []) // Replace named parameters $route = $this->namedRoutes[$routeName]; - + // prepend base path to route url again $url = $this->basePath . $route; @@ -277,7 +277,7 @@ protected function compileRoute($route) } $optional = $optional !== '' ? '?' : null; - + //Older versions of PCRE require the 'P' in (?P) $pattern = '(?:' . ($pre !== '' ? $pre : null)