@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->request = $request; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function __invoke($name = null, $params = [], $options = [], $reuseMatchedParams = false) |
|
| 41 | + public function __invoke($name = null, $params = [ ], $options = [ ], $reuseMatchedParams = false) |
|
| 42 | 42 | { |
| 43 | 43 | if (null === $this->router) { |
| 44 | 44 | throw new Exception\RuntimeException('No RouteStackInterface instance provided'); |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | if (3 === func_num_args() && is_bool($options)) { |
| 48 | 48 | $reuseMatchedParams = $options; |
| 49 | - $options = []; |
|
| 49 | + $options = [ ]; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Inherit query parameters |
| 53 | 53 | if ($reuseMatchedParams) { |
| 54 | - $providedQueryParams = isset($options['query']) ? $options['query'] : []; |
|
| 54 | + $providedQueryParams = isset($options[ 'query' ]) ? $options[ 'query' ] : [ ]; |
|
| 55 | 55 | $currentQueryParams = $this->request->getQuery()->toArray(); |
| 56 | - $options['query'] = array_merge($currentQueryParams, $providedQueryParams); |
|
| 56 | + $options[ 'query' ] = array_merge($currentQueryParams, $providedQueryParams); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | return parent::__invoke($name, $params, $options, $reuseMatchedParams); |
@@ -33,14 +33,14 @@ |
||
| 33 | 33 | { |
| 34 | 34 | $path = __DIR__.'/../../../themes/'; |
| 35 | 35 | $dir = new DirectoryIterator($path); |
| 36 | - $themesConfig = []; |
|
| 36 | + $themesConfig = [ ]; |
|
| 37 | 37 | |
| 38 | 38 | foreach ($dir as $file) { |
| 39 | 39 | if (!$file->isDot()) { |
| 40 | 40 | $hasConfig = $path.$file->getBasename().'/config/module.config.php'; |
| 41 | 41 | |
| 42 | 42 | if (is_file($hasConfig)) { |
| 43 | - $themesConfig['themes'][$file->getBasename()] = include $hasConfig; |
|
| 43 | + $themesConfig[ 'themes' ][ $file->getBasename() ] = include $hasConfig; |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $config = $serviceLocator->get('Config'); |
| 36 | 36 | $headScript = $serviceLocator->get('ViewHelperManager')->get('HeadScript'); |
| 37 | 37 | $headLink = $serviceLocator->get('ViewHelperManager')->get('headLink'); |
| 38 | - $publicDir = '/themes/'.$config['theme']['name'].DIRECTORY_SEPARATOR; |
|
| 38 | + $publicDir = '/themes/'.$config[ 'theme' ][ 'name' ].DIRECTORY_SEPARATOR; |
|
| 39 | 39 | |
| 40 | 40 | /* |
| 41 | 41 | * Get theme name from config and load it. |
@@ -44,22 +44,22 @@ discard block |
||
| 44 | 44 | * from indexAction. |
| 45 | 45 | */ |
| 46 | 46 | $viewTemplate = $serviceLocator->get('ViewTemplatePathStack'); |
| 47 | - $themes = $themesConfig['themes'][$config['theme']['name']]; |
|
| 47 | + $themes = $themesConfig[ 'themes' ][ $config[ 'theme' ][ 'name' ] ]; |
|
| 48 | 48 | |
| 49 | - if (isset($themes['template_path_stack'])) { |
|
| 50 | - $viewTemplate->addPaths($themes['template_path_stack']); |
|
| 49 | + if (isset($themes[ 'template_path_stack' ])) { |
|
| 50 | + $viewTemplate->addPaths($themes[ 'template_path_stack' ]); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if (isset($themes['template_map'])) { |
|
| 53 | + if (isset($themes[ 'template_map' ])) { |
|
| 54 | 54 | $viewTemplate = $serviceLocator->get('ViewTemplateMapResolver'); |
| 55 | - $viewTemplate->merge($themes['template_map']); |
|
| 55 | + $viewTemplate->merge($themes[ 'template_map' ]); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - foreach ($themes['css'] as $key => $file) { |
|
| 58 | + foreach ($themes[ 'css' ] as $key => $file) { |
|
| 59 | 59 | $headLink->prependStylesheet($publicDir.$file); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - foreach ($themes['js'] as $key => $file) { |
|
| 62 | + foreach ($themes[ 'js' ] as $key => $file) { |
|
| 63 | 63 | $headScript->prependFile($publicDir.$file); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return []; |
|
| 3 | +return [ ]; |
|
@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return []; |
|
| 3 | +return [ ]; |
|
@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return []; |
|
| 3 | +return [ ]; |
|
@@ -152,15 +152,15 @@ discard block |
||
| 152 | 152 | 'required' => false, |
| 153 | 153 | 'allow_empty' => true, |
| 154 | 154 | 'filters' => [ |
| 155 | - ['name' => 'Int'], |
|
| 155 | + [ 'name' => 'Int' ], |
|
| 156 | 156 | ], |
| 157 | 157 | ], |
| 158 | 158 | [ |
| 159 | 159 | 'name' => 'name', |
| 160 | 160 | 'required' => true, |
| 161 | 161 | 'filters' => [ |
| 162 | - ['name' => 'StripTags'], |
|
| 163 | - ['name' => 'StringTrim'], |
|
| 162 | + [ 'name' => 'StripTags' ], |
|
| 163 | + [ 'name' => 'StringTrim' ], |
|
| 164 | 164 | ], |
| 165 | 165 | 'validators' => [ |
| 166 | 166 | [ |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | [ |
| 180 | 180 | 'name' => 'InArray', |
| 181 | 181 | 'options' => [ |
| 182 | - 'haystack' => [2, 3], |
|
| 182 | + 'haystack' => [ 2, 3 ], |
|
| 183 | 183 | 'messages' => [ |
| 184 | 184 | 'notInArray' => 'Please select your gender !', |
| 185 | 185 | ], |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | 'name' => 'address', |
| 216 | 216 | 'required' => true, |
| 217 | 217 | 'filters' => [ |
| 218 | - ['name' => 'StripTags'], |
|
| 219 | - ['name' => 'StringTrim'], |
|
| 218 | + [ 'name' => 'StripTags' ], |
|
| 219 | + [ 'name' => 'StringTrim' ], |
|
| 220 | 220 | ], |
| 221 | 221 | 'validators' => [ |
| 222 | 222 | [ |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | $eventManager = $app->getEventManager(); |
| 44 | 44 | $sharedEventManager = $eventManager->getSharedManager(); |
| 45 | 45 | |
| 46 | - $eventManager->attach('render', [$this, 'loadTheme'], 100); |
|
| 47 | - $sharedEventManager->attach(ReloadService::class, 'reload', [$this, 'reloadConfig'], 100); |
|
| 46 | + $eventManager->attach('render', [ $this, 'loadTheme' ], 100); |
|
| 47 | + $sharedEventManager->attach(ReloadService::class, 'reload', [ $this, 'reloadConfig' ], 100); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $config = $this->service->get('Config'); |
| 58 | 58 | $this->service->setAllowOverride(true); |
| 59 | - $config['theme']['name'] = $request->getPost()['themeName']; |
|
| 59 | + $config[ 'theme' ][ 'name' ] = $request->getPost()[ 'themeName' ]; |
|
| 60 | 60 | $this->service->setService('Config', $config); |
| 61 | 61 | $this->service->setAllowOverride(false); |
| 62 | 62 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * @var array |
| 31 | 31 | */ |
| 32 | - private $themesConfig = []; |
|
| 32 | + private $themesConfig = [ ]; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * @var mixed |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | if ($request->isPost()) { |
| 62 | 62 | $filename = __DIR__.'/../../../config/module.config.php'; |
| 63 | 63 | $settings = include $filename; |
| 64 | - $themeName = $request->getPost()['themeName']; |
|
| 65 | - $settings['theme']['name'] = $themeName; |
|
| 64 | + $themeName = $request->getPost()[ 'themeName' ]; |
|
| 65 | + $settings[ 'theme' ][ 'name' ] = $themeName; |
|
| 66 | 66 | file_put_contents($filename, '<?php return '.var_export($settings, true).';'); |
| 67 | 67 | $this->reloadService->reload(); |
| 68 | 68 | } |