Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

RouteCollection no longer requires a ServiceLocator #38

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Dash/Router/Http/RouteCollection/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class RouteCollection implements RouteCollectionInterface
/**
* @param ServiceLocatorInterface $routeBuilder
*/
public function __construct(ServiceLocatorInterface $routeManager)
public function __construct(ServiceLocatorInterface $routeManager = null)
{
$this->routeManager = $routeManager;
}
Expand Down Expand Up @@ -93,7 +93,7 @@ public function get($name)

$route = $this->routes[$name]['route'];

if (!$route instanceof RouteInterface) {
if (!$route instanceof RouteInterface && null !== $this->routeManager) {
$type = (!isset($route['type']) ? 'generic' : $route['type']);
$route = $this->routes[$name]['route'] = $this->routeManager->get($type, $route);
}
Expand Down