| @@ -21,7 +21,7 @@ | ||
| 21 | 21 | public function indexAction() | 
| 22 | 22 |      { | 
| 23 | 23 | $this->layout(Module::DEFAULT_LAYOUT); | 
| 24 | - $view = new ViewModel([]); | |
| 24 | + $view = new ViewModel([ ]); | |
| 25 | 25 | $view->setTemplate(Package::FQPN . '/index/index'); | 
| 26 | 26 | |
| 27 | 27 | return $view; | 
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | |
| 41 | 41 | /** | 
| 42 | 42 | * @param FlatRouteCollection $routeCollection | 
| 43 | - * @param array $routesConfig | |
| 43 | + * @param RouteInterface $routesConfig | |
| 44 | 44 | * @param array $parentRoutesConfig | 
| 45 | 45 | */ | 
| 46 | 46 | private function processRoutes(FlatRouteCollection $routeCollection, array $routesConfig, array $parentRoutesConfig = null) | 
| @@ -22,7 +22,7 @@ discard block | ||
| 22 | 22 | * | 
| 23 | 23 | * @param array $routes | 
| 24 | 24 | */ | 
| 25 | - public function __construct(array $routes = []) | |
| 25 | + public function __construct(array $routes = [ ]) | |
| 26 | 26 |      { | 
| 27 | 27 | $this->routes = $routes; | 
| 28 | 28 | } | 
| @@ -47,28 +47,28 @@ discard block | ||
| 47 | 47 |      { | 
| 48 | 48 |          foreach (array_keys($routesConfig) as $k) { | 
| 49 | 49 | $routeName = $k; | 
| 50 | - $routeUrl = isset($routesConfig[$k]['options']['route']) ? $routesConfig[$k]['options']['route'] : ''; | |
| 50 | + $routeUrl = isset($routesConfig[ $k ][ 'options' ][ 'route' ]) ? $routesConfig[ $k ][ 'options' ][ 'route' ] : ''; | |
| 51 | 51 | |
| 52 | 52 |              if (!empty($parentRoutesConfig)) { | 
| 53 | 53 | $pk = key($parentRoutesConfig); | 
| 54 | 54 | |
| 55 | 55 | $routeName = $pk . '/' . $routeName; | 
| 56 | -                if (isset($parentRoutesConfig[$pk]['options']['route'])) { | |
| 57 | - $routeUrl = $parentRoutesConfig[$pk]['options']['route'] . $routeUrl; | |
| 56 | +                if (isset($parentRoutesConfig[ $pk ][ 'options' ][ 'route' ])) { | |
| 57 | + $routeUrl = $parentRoutesConfig[ $pk ][ 'options' ][ 'route' ] . $routeUrl; | |
| 58 | 58 | } | 
| 59 | 59 | } | 
| 60 | 60 | |
| 61 | - $controller = isset($routesConfig[$k]['options']['defaults']['controller']) | |
| 62 | - ? $routesConfig[$k]['options']['defaults']['controller'] : null; | |
| 63 | - $action = isset($routesConfig[$k]['options']['defaults']['action']) | |
| 64 | - ? $routesConfig[$k]['options']['defaults']['action'] : null; | |
| 61 | + $controller = isset($routesConfig[ $k ][ 'options' ][ 'defaults' ][ 'controller' ]) | |
| 62 | + ? $routesConfig[ $k ][ 'options' ][ 'defaults' ][ 'controller' ] : null; | |
| 63 | + $action = isset($routesConfig[ $k ][ 'options' ][ 'defaults' ][ 'action' ]) | |
| 64 | + ? $routesConfig[ $k ][ 'options' ][ 'defaults' ][ 'action' ] : null; | |
| 65 | 65 | $route = new Route($routeName, $routeUrl, $controller, $action); | 
| 66 | 66 | $routeCollection->addRoute($route); | 
| 67 | 67 | |
| 68 | -            if (isset($routesConfig[$k]['child_routes']) && !empty($routesConfig[$k]['child_routes'])) { | |
| 69 | - $childRoutes = $routesConfig[$k]['child_routes']; | |
| 70 | - unset($routesConfig[$k]['child_routes']); | |
| 71 | - $this->processRoutes($routeCollection, $childRoutes, [$k => $routesConfig[$k]]); | |
| 68 | +            if (isset($routesConfig[ $k ][ 'child_routes' ]) && !empty($routesConfig[ $k ][ 'child_routes' ])) { | |
| 69 | + $childRoutes = $routesConfig[ $k ][ 'child_routes' ]; | |
| 70 | + unset($routesConfig[ $k ][ 'child_routes' ]); | |
| 71 | + $this->processRoutes($routeCollection, $childRoutes, [ $k => $routesConfig[ $k ] ]); | |
| 72 | 72 | } | 
| 73 | 73 | } | 
| 74 | 74 | } | 
| @@ -24,7 +24,7 @@ | ||
| 24 | 24 |      { | 
| 25 | 25 | /** @var array $config */ | 
| 26 | 26 |          $config = $serviceLocator->get('config'); | 
| 27 | - $config = isset($config['router']['routes']) ? $config['router']['routes'] : []; | |
| 27 | + $config = isset($config[ 'router' ][ 'routes' ]) ? $config[ 'router' ][ 'routes' ] : [ ]; | |
| 28 | 28 | |
| 29 | 29 | /** @var RouteInterface $router */ | 
| 30 | 30 |          $router = $serviceLocator->get('router'); | 
| @@ -32,7 +32,7 @@ discard block | ||
| 32 | 32 | */ | 
| 33 | 33 | public function getModuleDependencies() | 
| 34 | 34 |      { | 
| 35 | - return ['AssetManager']; | |
| 35 | + return [ 'AssetManager' ]; | |
| 36 | 36 | } | 
| 37 | 37 | |
| 38 | 38 | /** | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | 59 | $currentRouteName = $this->getCurrentRouteName($e->getApplication()->getServiceManager()); | 
| 60 | - $e->getViewModel()->setVariables(['__currentRouteName' => $currentRouteName]); | |
| 60 | + $e->getViewModel()->setVariables([ '__currentRouteName' => $currentRouteName ]); | |
| 61 | 61 | } | 
| 62 | 62 | |
| 63 | 63 | /** | 
| @@ -20,7 +20,7 @@ discard block | ||
| 20 | 20 | * | 
| 21 | 21 | * @param array $routes | 
| 22 | 22 | */ | 
| 23 | - public function __construct(array $routes = []) | |
| 23 | + public function __construct(array $routes = [ ]) | |
| 24 | 24 |      { | 
| 25 | 25 | $this->routes = $routes; | 
| 26 | 26 | } | 
| @@ -30,7 +30,7 @@ discard block | ||
| 30 | 30 | */ | 
| 31 | 31 | public function addRoute(Route $route) | 
| 32 | 32 |      { | 
| 33 | - $this->routes[$route->getName()] = $route; | |
| 33 | + $this->routes[ $route->getName() ] = $route; | |
| 34 | 34 | } | 
| 35 | 35 | |
| 36 | 36 | /** |