@@ -196,10 +196,10 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function setProperties(array $properties) |
| 198 | 198 | { |
| 199 | - if (isset($properties[ 'presets' ])) { |
|
| 200 | - $this->setPresets($properties[ 'presets' ]); |
|
| 199 | + if (isset($properties['presets'])) { |
|
| 200 | + $this->setPresets($properties['presets']); |
|
| 201 | 201 | |
| 202 | - unset($properties[ 'presets' ]); |
|
| 202 | + unset($properties['presets']); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $this->properties = $properties; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $themes = []; |
| 290 | 290 | foreach ($directory->getTree() as $themeName => $themeTree) { |
| 291 | 291 | if (($theme = $this->getTheme($themeName)) instanceof Module\Theme) { |
| 292 | - $themes[ $themeName ] = $theme; |
|
| 292 | + $themes[$themeName] = $theme; |
|
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | |
@@ -312,9 +312,9 @@ discard block |
||
| 312 | 312 | $dirPath = str_replace(PATH_APP, '', $this->getRealPath()); |
| 313 | 313 | $dirPathParts = explode(DIRECTORY_SEPARATOR, $dirPath); |
| 314 | 314 | |
| 315 | - if(count($dirPathParts)) { |
|
| 315 | + if (count($dirPathParts)) { |
|
| 316 | 316 | $dirPathParts = array_map('dash', $dirPathParts); |
| 317 | - $dirResources.= implode(DIRECTORY_SEPARATOR, $dirPathParts); |
|
| 317 | + $dirResources .= implode(DIRECTORY_SEPARATOR, $dirPathParts); |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | if (is_null($subDir)) { |
@@ -105,12 +105,12 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // autoload presenter assets |
| 108 | - if (isset($config[ 'assets' ])) { |
|
| 109 | - $this->assets->autoload($config[ 'assets' ]); |
|
| 108 | + if (isset($config['assets'])) { |
|
| 109 | + $this->assets->autoload($config['assets']); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | // autoload presenter theme |
| 113 | - if(isset($config['theme'])) { |
|
| 113 | + if (isset($config['theme'])) { |
|
| 114 | 114 | $this->setTheme($config['theme']); |
| 115 | 115 | } |
| 116 | 116 | |
@@ -128,19 +128,19 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function setTheme($theme) |
| 130 | 130 | { |
| 131 | - if($this->theme instanceof Theme) { |
|
| 131 | + if ($this->theme instanceof Theme) { |
|
| 132 | 132 | $this->assets->removeFilePath($this->theme->getRealPath()); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if (is_bool($theme)) { |
| 136 | 136 | $this->theme = false; |
| 137 | - } elseif(($moduleTheme = modules()->top()->getTheme($theme, true)) instanceof Theme) { |
|
| 137 | + } elseif (($moduleTheme = modules()->top()->getTheme($theme, true)) instanceof Theme) { |
|
| 138 | 138 | $this->theme = $moduleTheme; |
| 139 | - } elseif(($appTheme = modules()->first()->getTheme($theme, true)) instanceof Theme) { |
|
| 139 | + } elseif (($appTheme = modules()->first()->getTheme($theme, true)) instanceof Theme) { |
|
| 140 | 140 | $this->theme = $appTheme; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - if($this->theme) { |
|
| 143 | + if ($this->theme) { |
|
| 144 | 144 | if ( ! defined('PATH_THEME')) { |
| 145 | 145 | define('PATH_THEME', $this->theme->getRealPath()); |
| 146 | 146 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | // add theme assets directory |
| 149 | 149 | $this->assets->pushFilePath($this->theme->getRealPath()); |
| 150 | 150 | |
| 151 | - if(is_dir($themeViewPath = $this->theme->getRealPath() . 'views' . DIRECTORY_SEPARATOR)) { |
|
| 151 | + if (is_dir($themeViewPath = $this->theme->getRealPath() . 'views' . DIRECTORY_SEPARATOR)) { |
|
| 152 | 152 | |
| 153 | 153 | // add theme view directory |
| 154 | 154 | view()->addFilePath($this->theme->getRealPath()); |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | $modules = modules()->getArrayCopy(); |
| 160 | 160 | |
| 161 | - foreach($modules as $module) { |
|
| 161 | + foreach ($modules as $module) { |
|
| 162 | 162 | if ( ! in_array($module->getType(), ['KERNEL', 'FRAMEWORK', 'APP'])) { |
| 163 | 163 | $moduleResourcesPath = str_replace(PATH_RESOURCES, '', $module->getResourcesDir()); |
| 164 | 164 | |
| 165 | - if(is_dir($themeViewPath . $moduleResourcesPath)) { |
|
| 165 | + if (is_dir($themeViewPath . $moduleResourcesPath)) { |
|
| 166 | 166 | view()->pushFilePath($themeViewPath . $moduleResourcesPath); |
| 167 | 167 | } |
| 168 | 168 | } |
@@ -203,25 +203,25 @@ discard block |
||
| 203 | 203 | $storage = $this->storage; |
| 204 | 204 | |
| 205 | 205 | // Add Properties |
| 206 | - $storage[ 'meta' ] = $this->meta; |
|
| 207 | - $storage[ 'page' ] = $this->page; |
|
| 208 | - $storage[ 'assets' ] = new SplArrayObject([ |
|
| 206 | + $storage['meta'] = $this->meta; |
|
| 207 | + $storage['page'] = $this->page; |
|
| 208 | + $storage['assets'] = new SplArrayObject([ |
|
| 209 | 209 | 'head' => $this->assets->getHead(), |
| 210 | 210 | 'body' => $this->assets->getBody(), |
| 211 | 211 | ]); |
| 212 | - $storage[ 'partials' ] = $this->partials; |
|
| 213 | - $storage[ 'widgets' ] = $this->widgets; |
|
| 214 | - $storage[ 'theme' ] = $this->theme; |
|
| 212 | + $storage['partials'] = $this->partials; |
|
| 213 | + $storage['widgets'] = $this->widgets; |
|
| 214 | + $storage['theme'] = $this->theme; |
|
| 215 | 215 | |
| 216 | 216 | // Add Services |
| 217 | - $storage[ 'config' ] = config(); |
|
| 218 | - $storage[ 'language' ] = language(); |
|
| 219 | - $storage[ 'session' ] = session(); |
|
| 220 | - $storage[ 'presenter' ] = presenter(); |
|
| 221 | - $storage[ 'input' ] = input(); |
|
| 217 | + $storage['config'] = config(); |
|
| 218 | + $storage['language'] = language(); |
|
| 219 | + $storage['session'] = session(); |
|
| 220 | + $storage['presenter'] = presenter(); |
|
| 221 | + $storage['input'] = input(); |
|
| 222 | 222 | |
| 223 | 223 | if (services()->has('csrfProtection')) { |
| 224 | - $storage[ 'csrfToken' ] = services()->get('csrfProtection')->getToken(); |
|
| 224 | + $storage['csrfToken'] = services()->get('csrfProtection')->getToken(); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | return $storage; |