Commit 70be3bbd authored by Tino Goratsch's avatar Tino Goratsch

add some type hinting + code cleanup for the router

parent 8d9f1fff
......@@ -28,10 +28,6 @@ class Router implements RouterInterface
* @var SettingsInterface
*/
protected $config;
/**
* @var string
*/
protected $environment;
/**
* Router constructor.
......@@ -39,18 +35,15 @@ class Router implements RouterInterface
* @param RequestInterface $request
* @param ApplicationPath $appPath
* @param SettingsInterface $config
* @param string $environment
*/
public function __construct(
RequestInterface $request,
ApplicationPath $appPath,
SettingsInterface $config,
string $environment
SettingsInterface $config
) {
$this->request = $request;
$this->appPath = $appPath;
$this->config = $config;
$this->environment = $environment;
}
/**
......
......@@ -7,7 +7,6 @@
namespace ACP3\Core\Test;
use ACP3\Core\Environment\ApplicationMode;
use ACP3\Core\Environment\ApplicationPath;
use ACP3\Core\Http\Request;
use ACP3\Core\Router\Router;
......@@ -39,8 +38,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase
$this->router = new Router(
$this->requestMock,
$this->appPathMock,
$this->configMock,
ApplicationMode::PRODUCTION
$this->configMock
);
}
......
......@@ -55,7 +55,6 @@ services:
- '@core.http.request'
- '@core.environment.application_path'
- '@core.config'
- '%core.environment%'
core.session:
class: ACP3\Core\Session\SessionHandler
......
......@@ -23,16 +23,14 @@ class Router extends \ACP3\Core\Router\Router
* @param \ACP3\Core\Http\RequestInterface $request
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Settings\SettingsInterface $config
* @param string $environment
*/
public function __construct(
Aliases $aliases,
RequestInterface $request,
ApplicationPath $appPath,
SettingsInterface $config,
string $environment
SettingsInterface $config
) {
parent::__construct($request, $appPath, $config, $environment);
parent::__construct($request, $appPath, $config);
$this->aliases = $aliases;
}
......
......@@ -32,4 +32,3 @@ services:
- '@core.http.request'
- '@core.environment.application_path'
- '@core.config'
- '%core.environment%'
......@@ -7,7 +7,6 @@
namespace ACP3\Modules\ACP3\Seo\Test\Core;
use ACP3\Core\Environment\ApplicationMode;
use ACP3\Modules\ACP3\Seo\Core\Router\Aliases;
use ACP3\Modules\ACP3\Seo\Core\Router\Router;
......@@ -26,8 +25,7 @@ class RouterTest extends \ACP3\Core\Test\RouterTest
$this->aliasesMock,
$this->requestMock,
$this->appPathMock,
$this->configMock,
ApplicationMode::PRODUCTION
$this->configMock
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment