Add App\Router dependency injection to App

- Moved collectRoutes method from App to App\Router
This commit is contained in:
Hypolite Petovan 2019-04-05 23:16:12 -04:00
parent 7383511855
commit d6d31f43a1
6 changed files with 65 additions and 36 deletions

View file

@ -24,6 +24,7 @@ class DependencyFactory
{
$basePath = BasePath::create($directory, $_SERVER);
$mode = new App\Mode($basePath);
$router = new App\Router();
$configLoader = new Config\ConfigFileLoader($basePath, $mode);
$configCache = Factory\ConfigFactory::createCache($configLoader);
$profiler = Factory\ProfilerFactory::create($configCache);
@ -34,6 +35,6 @@ class DependencyFactory
$logger = Factory\LoggerFactory::create($channel, $config, $profiler);
Factory\LoggerFactory::createDev($channel, $config, $profiler);
return new App($config, $mode, $logger, $profiler, $isBackend);
return new App($config, $mode, $router, $logger, $profiler, $isBackend);
}
}