I am in argument as junior with a senior dev that says my routing is wrong and dangerous, that potentially all request could be routed to homepege, but I think he is wrong and I even tested it. He says that by adding this
$this->router[] = new Route('/', 'Front:Bridge:default');
All routes below this definition will be ignored and everything will be routed to Front:Bridge
Which I think is BS, since the route clearly states that redirect ONLY request directly to web root to Front:Bridge. And functionality of app is indeed not changed, but he insists I am sure to introduce unforseen bug somewhere.
Whole routerFactory for ref
public function getRouter()
{
$this->router[] = new Route('/muj-ucet[/<action=default>]', [
'module' => 'Front',
'presenter' => 'Account',
'action' => [
Route::VALUE => 'default',
Route::FILTER_TABLE => [
'zpravy' => 'message',
'profil' => 'profile',
'objednavky' => 'orders',
'sprava-uzivatelu' => 'users'
],
],
]);
$this->router[] = new Route('/', 'Front:Bridge:default');
$this->router[] = new Route('[<lang [a-zA-Z]{2}>/]html/prihlaseni.html', 'OnlineUser:Front:Login:default');
$this->router[] = new Route('/superadmin/prihlaseni', 'OnlineUser:Front:Login:superAdminLogin');
$this->router[] = new Route('[<lang [a-zA-Z]{2}>/]html/registrace.html', 'OnlineUser:Front:Registration:default');
$this->router[] = new Route('/potvrzeni-registrace', Linker::ACTION_CONFIRM_REGISTRATION);
$this->router[] = new Route('/aktivace-uctu', Linker::ACTION_ACTIVATION_ACCOUNT);
$this->router[] = new Route('/nove-heslo', Linker::ACTION_FORGOT_PASSWORD);
$this->router[] = new Route('/logout', 'OnlineUser:Front:Login:logout');
$this->router[] = new Route('/validace/<action=default>', [
'module' => 'OnlineUser:Front',
'presenter' => 'Validation',
'action' => [
Route::VALUE => 'default',
Route::FILTER_TABLE => [
'validace-emailu' => 'validateEmailNotExists',
'validace-ico' => 'validateIcNotExists',
'validace-ico-ares-heo' => 'validateIcAresAndHeO',
],
],
]);
$this->router[] = new Route('[<path .+>]', 'Front:Bridge:default');
return $this->router;
}