Skip to content

Commit

Permalink
type-hint array in constructor parameter too
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Nov 10, 2019
1 parent 3a97b2c commit 7e2b48d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions AltoRouter.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -277,7 +277,7 @@ protected function compileRoute($route)
}

$optional = $optional !== '' ? '?' : null;

//Older versions of PCRE require the 'P' in (?P<named>)
$pattern = '(?:'
. ($pre !== '' ? $pre : null)
Expand Down

0 comments on commit 7e2b48d

Please sign in to comment.