@@ -105,8 +105,8 @@ 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 | return $this; |
@@ -183,25 +183,25 @@ discard block |
||
183 | 183 | $storage = $this->storage; |
184 | 184 | |
185 | 185 | // Add Properties |
186 | - $storage[ 'meta' ] = $this->meta; |
|
187 | - $storage[ 'page' ] = $this->page; |
|
188 | - $storage[ 'assets' ] = new SplArrayObject([ |
|
186 | + $storage['meta'] = $this->meta; |
|
187 | + $storage['page'] = $this->page; |
|
188 | + $storage['assets'] = new SplArrayObject([ |
|
189 | 189 | 'head' => $this->assets->getHead(), |
190 | 190 | 'body' => $this->assets->getBody(), |
191 | 191 | ]); |
192 | - $storage[ 'partials' ] = $this->partials; |
|
193 | - $storage[ 'widgets' ] = $this->widgets; |
|
194 | - $storage[ 'theme' ] = $this->theme; |
|
192 | + $storage['partials'] = $this->partials; |
|
193 | + $storage['widgets'] = $this->widgets; |
|
194 | + $storage['theme'] = $this->theme; |
|
195 | 195 | |
196 | 196 | // Add Services |
197 | - $storage[ 'config' ] = config(); |
|
198 | - $storage[ 'language' ] = language(); |
|
199 | - $storage[ 'session' ] = session(); |
|
200 | - $storage[ 'presenter' ] = presenter(); |
|
201 | - $storage[ 'input' ] = input(); |
|
197 | + $storage['config'] = config(); |
|
198 | + $storage['language'] = language(); |
|
199 | + $storage['session'] = session(); |
|
200 | + $storage['presenter'] = presenter(); |
|
201 | + $storage['input'] = input(); |
|
202 | 202 | |
203 | 203 | if (services()->has('csrfProtection')) { |
204 | - $storage[ 'csrfToken' ] = services()->get('csrfProtection')->getToken(); |
|
204 | + $storage['csrfToken'] = services()->get('csrfProtection')->getToken(); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | return $storage; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | } else { |
65 | 65 | $uriPath = urldecode( |
66 | - parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH) |
|
66 | + parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) |
|
67 | 67 | ); |
68 | 68 | |
69 | 69 | $uriPathParts = explode('public/', $uriPath); |
@@ -233,12 +233,12 @@ discard block |
||
233 | 233 | presenter()->page->setFile($pageFilePath); |
234 | 234 | } else { |
235 | 235 | $pageFilePath = str_replace('.phtml', DIRECTORY_SEPARATOR . 'index.phtml', $pageFilePath); |
236 | - if(is_file($pageFilePath)) { |
|
236 | + if (is_file($pageFilePath)) { |
|
237 | 237 | presenter()->page->setFile($pageFilePath); |
238 | 238 | } |
239 | 239 | } |
240 | 240 | |
241 | - if(presenter()->page->file instanceof SplFileInfo) { |
|
241 | + if (presenter()->page->file instanceof SplFileInfo) { |
|
242 | 242 | $this->setController( |
243 | 243 | (new KernelControllerDataStructure($controllerClassName)) |
244 | 244 | ->setRequestMethod('index') |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | if (class_exists($controllerClassName)) { |
316 | 316 | $this->addresses->any( |
317 | 317 | '/', |
318 | - function () use ($controllerClassName) { |
|
318 | + function() use ($controllerClassName) { |
|
319 | 319 | return new $controllerClassName(); |
320 | 320 | } |
321 | 321 | ); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | if (class_exists($controllerClassName)) { |
331 | 331 | $this->addresses->any( |
332 | 332 | '/', |
333 | - function () use ($controllerClassName) { |
|
333 | + function() use ($controllerClassName) { |
|
334 | 334 | return new $controllerClassName(); |
335 | 335 | } |
336 | 336 | ); |
@@ -382,8 +382,8 @@ discard block |
||
382 | 382 | ); |
383 | 383 | } elseif (preg_match("/([a-zA-Z0-9\\\]+)(@)([a-zA-Z0-9\\\]+)/", $closure, $matches)) { |
384 | 384 | $this->setController( |
385 | - (new KernelControllerDataStructure($matches[ 1 ])) |
|
386 | - ->setRequestMethod($matches[ 3 ]), |
|
385 | + (new KernelControllerDataStructure($matches[1])) |
|
386 | + ->setRequestMethod($matches[3]), |
|
387 | 387 | $uriSegments |
388 | 388 | ); |
389 | 389 | } elseif (presenter()->theme->use === true) { |
@@ -70,7 +70,7 @@ |
||
70 | 70 | $download = false; |
71 | 71 | if (false !== ($key = array_search('download', $segments))) { |
72 | 72 | $download = true; |
73 | - unset($segments[ $key ]); |
|
73 | + unset($segments[$key]); |
|
74 | 74 | $segments = array_values($segments); |
75 | 75 | } |
76 | 76 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function index() |
34 | 34 | { |
35 | - if($this->presenter->page->file instanceof SplFileInfo) { |
|
35 | + if ($this->presenter->page->file instanceof SplFileInfo) { |
|
36 | 36 | $this->view->page(presenter()->page->file->getRealPath()); |
37 | 37 | } |
38 | 38 | } |
@@ -155,12 +155,12 @@ |
||
155 | 155 | $properties = file_get_contents($propertiesFilePath); |
156 | 156 | $properties = json_decode($properties, true); |
157 | 157 | |
158 | - if (isset($properties[ 'vars' ])) { |
|
159 | - $this->vars = $properties[ 'vars' ]; |
|
158 | + if (isset($properties['vars'])) { |
|
159 | + $this->vars = $properties['vars']; |
|
160 | 160 | } |
161 | 161 | |
162 | - if (isset($properties[ 'presets' ])) { |
|
163 | - $this->presets = new SplArrayObject($properties[ 'presets' ]); |
|
162 | + if (isset($properties['presets'])) { |
|
163 | + $this->presets = new SplArrayObject($properties['presets']); |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $jsVersion = $this->getVersion($js); |
64 | 64 | $output[] = '<script type="text/javascript" src="' . $this->getUrl($js) . '?v=' . $jsVersion . '"></script>'; |
65 | 65 | } else { |
66 | - $bundleJsMap[ 'sources' ][] = $js; |
|
66 | + $bundleJsMap['sources'][] = $js; |
|
67 | 67 | $bundleJsContents[] = file_get_contents($js); |
68 | 68 | } |
69 | 69 | } |
@@ -71,17 +71,17 @@ discard block |
||
71 | 71 | // Bundled Js |
72 | 72 | $bundleJsVersion = $this->getVersion(serialize($bundleJsContents)); |
73 | 73 | |
74 | - if(presenter()->page->file instanceof \SplFileInfo) { |
|
75 | - if(presenter()->page->file->getFilename() === 'index') { |
|
74 | + if (presenter()->page->file instanceof \SplFileInfo) { |
|
75 | + if (presenter()->page->file->getFilename() === 'index') { |
|
76 | 76 | $bundleJsFilename = 'body-' . presenter()->page->file->getDirectoryInfo()->getDirName(); |
77 | 77 | } else { |
78 | 78 | $bundleJsFilename = 'body-' . presenter()->page->file->getDirectoryInfo()->getDirName() . '-' . presenter()->page->file->getFilename(); |
79 | 79 | } |
80 | - } elseif(services()->has('controller')) { |
|
80 | + } elseif (services()->has('controller')) { |
|
81 | 81 | $bundleJsFilename = 'body-' . controller()->getParameter(); |
82 | 82 | |
83 | - if(controller()->getRequestMethod() !== 'index') { |
|
84 | - $bundleJsFilename.= '-' . controller()->getRequestMethod(); |
|
83 | + if (controller()->getRequestMethod() !== 'index') { |
|
84 | + $bundleJsFilename .= '-' . controller()->getRequestMethod(); |
|
85 | 85 | } |
86 | 86 | } else { |
87 | 87 | $bundleJsFilename = 'body-' . md5($bundleJsVersion); |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | if (is_file($bundleJsFilePath . '.map')) { |
95 | 95 | $bundleJsMap = json_decode(file_get_contents($bundleJsFilePath . '.map'), true); |
96 | 96 | // if the file version is changed delete it first |
97 | - if ( ! hash_equals($bundleJsVersion, $bundleJsMap[ 'version' ])) { |
|
97 | + if ( ! hash_equals($bundleJsVersion, $bundleJsMap['version'])) { |
|
98 | 98 | unlink($bundleJsFilePath); |
99 | 99 | unlink($bundleJsFilePath . '.map'); |
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | 103 | if ( ! is_file($bundleJsFilePath)) { |
104 | - $bundleJsMap[ 'version' ] = $bundleJsVersion; |
|
104 | + $bundleJsMap['version'] = $bundleJsVersion; |
|
105 | 105 | |
106 | 106 | // Create css file |
107 | 107 | if (count($bundleJsContents)) { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | - if(is_file($bundleJsFilePath)) { |
|
131 | + if (is_file($bundleJsFilePath)) { |
|
132 | 132 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
133 | 133 | $output[] = '<script type="text/javascript" src="' . $this->getUrl($bundleJsMinifyFilePath) . '?v=' . $bundleJsVersion . '"></script>'; |
134 | 134 | } else { |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | if (is_file($bundleFontFilePath . '.map')) { |
82 | 82 | $bundleFontMap = json_decode(file_get_contents($bundleFontFilePath . '.map'), true); |
83 | 83 | // if the file version is changed delete it first |
84 | - if ( ! hash_equals($bundleFontVersion, $bundleFontMap[ 'version' ])) { |
|
84 | + if ( ! hash_equals($bundleFontVersion, $bundleFontMap['version'])) { |
|
85 | 85 | unlink($bundleFontFilePath); |
86 | 86 | unlink($bundleFontFilePath . '.map'); |
87 | 87 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | flock($bundleFileStream, LOCK_EX); |
98 | 98 | |
99 | 99 | foreach ($this->font as $font) { |
100 | - $bundleFontMap[ 'sources' ][] = $font; |
|
100 | + $bundleFontMap['sources'][] = $font; |
|
101 | 101 | fwrite($bundleFileStream, file_get_contents($font)); |
102 | 102 | } |
103 | 103 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $cssVersion = $this->getVersion($css); |
139 | 139 | $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $this->getUrl($css) . '?v=' . $cssVersion . '">'; |
140 | 140 | } else { |
141 | - $bundleCssMap[ 'sources' ][] = $css; |
|
141 | + $bundleCssMap['sources'][] = $css; |
|
142 | 142 | $bundleCssContents[] = file_get_contents($css); |
143 | 143 | } |
144 | 144 | } |
@@ -146,17 +146,17 @@ discard block |
||
146 | 146 | // Bundled Css |
147 | 147 | $bundleCssVersion = $this->getVersion(serialize($bundleCssContents)); |
148 | 148 | |
149 | - if(presenter()->page->file instanceof \SplFileInfo) { |
|
150 | - if(presenter()->page->file->getFilename() === 'index') { |
|
149 | + if (presenter()->page->file instanceof \SplFileInfo) { |
|
150 | + if (presenter()->page->file->getFilename() === 'index') { |
|
151 | 151 | $bundleJsFilename = 'body-' . presenter()->page->file->getDirectoryInfo()->getDirName(); |
152 | 152 | } else { |
153 | 153 | $bundleJsFilename = 'body-' . presenter()->page->file->getDirectoryInfo()->getDirName() . '-' . presenter()->page->file->getFilename(); |
154 | 154 | } |
155 | - } elseif(services()->has('controller')) { |
|
155 | + } elseif (services()->has('controller')) { |
|
156 | 156 | $bundleJsFilename = 'body-' . controller()->getParameter(); |
157 | 157 | |
158 | - if(controller()->getRequestMethod() !== 'index') { |
|
159 | - $bundleJsFilename.= '-' . controller()->getRequestMethod(); |
|
158 | + if (controller()->getRequestMethod() !== 'index') { |
|
159 | + $bundleJsFilename .= '-' . controller()->getRequestMethod(); |
|
160 | 160 | } |
161 | 161 | } else { |
162 | 162 | $bundleJsFilename = 'body-' . md5($bundleCssVersion); |
@@ -169,14 +169,14 @@ discard block |
||
169 | 169 | if (is_file($bundleCssFilePath . '.map')) { |
170 | 170 | $bundleCssMap = json_decode(file_get_contents($bundleCssFilePath . '.map'), true); |
171 | 171 | // if the file version is changed delete it first |
172 | - if ( ! hash_equals($bundleCssVersion, $bundleCssMap[ 'version' ])) { |
|
172 | + if ( ! hash_equals($bundleCssVersion, $bundleCssMap['version'])) { |
|
173 | 173 | unlink($bundleCssFilePath); |
174 | 174 | unlink($bundleCssFilePath . '.map'); |
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
178 | 178 | if ( ! is_file($bundleCssFilePath)) { |
179 | - $bundleCssMap[ 'version' ] = $bundleCssVersion; |
|
179 | + $bundleCssMap['version'] = $bundleCssVersion; |
|
180 | 180 | |
181 | 181 | // Create css file |
182 | 182 | if (count($bundleCssContents)) { |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $jsVersion = $this->getVersion($js); |
223 | 223 | $output[] = '<script type="text/javascript" src="' . $this->getUrl($js) . '?v=' . $jsVersion . '"></script>'; |
224 | 224 | } else { |
225 | - $bundleJsMap[ 'sources' ][] = $js; |
|
225 | + $bundleJsMap['sources'][] = $js; |
|
226 | 226 | $bundleJsContents[] = file_get_contents($js); |
227 | 227 | } |
228 | 228 | } |
@@ -230,17 +230,17 @@ discard block |
||
230 | 230 | // Bundled Js |
231 | 231 | $bundleJsVersion = $this->getVersion(serialize($bundleJsContents)); |
232 | 232 | |
233 | - if(presenter()->page->file instanceof \SplFileInfo) { |
|
234 | - if(presenter()->page->file->getFilename() === 'index') { |
|
233 | + if (presenter()->page->file instanceof \SplFileInfo) { |
|
234 | + if (presenter()->page->file->getFilename() === 'index') { |
|
235 | 235 | $bundleJsFilename = 'body-' . presenter()->page->file->getDirectoryInfo()->getDirName(); |
236 | 236 | } else { |
237 | 237 | $bundleJsFilename = 'body-' . presenter()->page->file->getDirectoryInfo()->getDirName() . '-' . presenter()->page->file->getFilename(); |
238 | 238 | } |
239 | - } elseif(services()->has('controller')) { |
|
239 | + } elseif (services()->has('controller')) { |
|
240 | 240 | $bundleJsFilename = 'body-' . controller()->getParameter(); |
241 | 241 | |
242 | - if(controller()->getRequestMethod() !== 'index') { |
|
243 | - $bundleJsFilename.= '-' . controller()->getRequestMethod(); |
|
242 | + if (controller()->getRequestMethod() !== 'index') { |
|
243 | + $bundleJsFilename .= '-' . controller()->getRequestMethod(); |
|
244 | 244 | } |
245 | 245 | } else { |
246 | 246 | $bundleJsFilename = 'body-' . md5($bundleJsVersion); |
@@ -253,14 +253,14 @@ discard block |
||
253 | 253 | if (is_file($bundleJsFilePath . '.map')) { |
254 | 254 | $bundleJsMap = json_decode(file_get_contents($bundleJsFilePath . '.map'), true); |
255 | 255 | // if the file version is changed delete it first |
256 | - if ( ! hash_equals($bundleJsVersion, $bundleJsMap[ 'version' ])) { |
|
256 | + if ( ! hash_equals($bundleJsVersion, $bundleJsMap['version'])) { |
|
257 | 257 | unlink($bundleJsFilePath); |
258 | 258 | unlink($bundleJsFilePath . '.map'); |
259 | 259 | } |
260 | 260 | } |
261 | 261 | |
262 | 262 | if ( ! is_file($bundleJsFilePath)) { |
263 | - $bundleJsMap[ 'version' ] = $bundleJsVersion; |
|
263 | + $bundleJsMap['version'] = $bundleJsVersion; |
|
264 | 264 | |
265 | 265 | // Create css file |
266 | 266 | if (count($bundleJsContents)) { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | } |
288 | 288 | } |
289 | 289 | |
290 | - if(is_file($bundleJsFilePath)) { |
|
290 | + if (is_file($bundleJsFilePath)) { |
|
291 | 291 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
292 | 292 | $output[] = '<script type="text/javascript" src="' . $this->getUrl($bundleJsMinifyFilePath) . '?v=' . $bundleJsVersion . '"></script>'; |
293 | 293 | } else { |
@@ -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 |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | |
185 | 185 | if (isset($config) AND is_array($config)) { |
186 | 186 | // Set default timezone |
187 | - if (isset($config[ 'datetime' ][ 'timezone' ])) { |
|
188 | - date_default_timezone_set($config[ 'datetime' ][ 'timezone' ]); |
|
187 | + if (isset($config['datetime']['timezone'])) { |
|
188 | + date_default_timezone_set($config['datetime']['timezone']); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | // Setup Language Ideom and Locale |
192 | - if (isset($config[ 'language' ])) { |
|
193 | - language()->setDefault($config[ 'language' ]); |
|
192 | + if (isset($config['language'])) { |
|
193 | + language()->setDefault($config['language']); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | config()->merge($config); |
@@ -420,8 +420,8 @@ discard block |
||
420 | 420 | $packageJsonFile = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $packageJsonFile); |
421 | 421 | $packageJsonFileInfo = pathinfo($packageJsonFile); |
422 | 422 | |
423 | - if ($packageJsonFileInfo[ 'filename' ] === 'widget' or |
|
424 | - $packageJsonFileInfo[ 'filename' ] === 'language' or |
|
423 | + if ($packageJsonFileInfo['filename'] === 'widget' or |
|
424 | + $packageJsonFileInfo['filename'] === 'language' or |
|
425 | 425 | strpos($packageJsonFile, '.svn') !== false // subversion properties file conflict. |
426 | 426 | ) { |
427 | 427 | continue; |
@@ -451,8 +451,8 @@ discard block |
||
451 | 451 | } |
452 | 452 | |
453 | 453 | if (strpos($packageJsonFile, |
454 | - $modularType = ucfirst(plural($packageJsonFileInfo[ 'filename' ])) . DIRECTORY_SEPARATOR) === false) { |
|
455 | - $modularType = ucfirst($packageJsonFileInfo[ 'filename' ]) . DIRECTORY_SEPARATOR; |
|
454 | + $modularType = ucfirst(plural($packageJsonFileInfo['filename'])) . DIRECTORY_SEPARATOR) === false) { |
|
455 | + $modularType = ucfirst($packageJsonFileInfo['filename']) . DIRECTORY_SEPARATOR; |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | $modularType = strtolower(rtrim($modularType, DIRECTORY_SEPARATOR)); |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | PATH_PUBLIC, |
468 | 468 | PATH_RESOURCES, |
469 | 469 | PATH_APP, |
470 | - $packageJsonFileInfo[ 'basename' ], |
|
470 | + $packageJsonFileInfo['basename'], |
|
471 | 471 | ucfirst($modularType) . DIRECTORY_SEPARATOR, |
472 | 472 | ], |
473 | 473 | '', |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | ) |
478 | 478 | ); |
479 | 479 | |
480 | - $moduleSegments = array_map(function ($string) { |
|
480 | + $moduleSegments = array_map(function($string) { |
|
481 | 481 | return dash(snakecase($string)); |
482 | 482 | }, $moduleSegments); |
483 | 483 | |
@@ -485,14 +485,14 @@ discard block |
||
485 | 485 | str_replace( |
486 | 486 | PATH_ROOT, |
487 | 487 | '', |
488 | - $packageJsonFileInfo[ 'dirname' ] |
|
488 | + $packageJsonFileInfo['dirname'] |
|
489 | 489 | ), |
490 | 490 | false |
491 | 491 | ); |
492 | 492 | |
493 | - if (isset($packageJsonMetadata[ 'namespace' ])) { |
|
494 | - $moduleNamespace = $packageJsonMetadata[ 'namespace' ]; |
|
495 | - unset($packageJsonMetadata[ 'namespace' ]); |
|
493 | + if (isset($packageJsonMetadata['namespace'])) { |
|
494 | + $moduleNamespace = $packageJsonMetadata['namespace']; |
|
495 | + unset($packageJsonMetadata['namespace']); |
|
496 | 496 | } |
497 | 497 | |
498 | 498 | $moduleParentSegments = []; |
@@ -506,16 +506,16 @@ discard block |
||
506 | 506 | $registryKey = implode('/', $moduleSegments); |
507 | 507 | |
508 | 508 | if ($registryKey === '') { |
509 | - if ($packageJsonFileInfo[ 'dirname' ] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
509 | + if ($packageJsonFileInfo['dirname'] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
510 | 510 | $registryKey = dash(snakecase( |
511 | - pathinfo($packageJsonFileInfo[ 'dirname' ], PATHINFO_FILENAME))); |
|
511 | + pathinfo($packageJsonFileInfo['dirname'], PATHINFO_FILENAME))); |
|
512 | 512 | } |
513 | 513 | } |
514 | 514 | |
515 | - $registry[ $registryKey ] = (new DataStructures\Module( |
|
516 | - $packageJsonFileInfo[ 'dirname' ] |
|
515 | + $registry[$registryKey] = (new DataStructures\Module( |
|
516 | + $packageJsonFileInfo['dirname'] |
|
517 | 517 | )) |
518 | - ->setType($packageJsonFileInfo[ 'filename' ]) |
|
518 | + ->setType($packageJsonFileInfo['filename']) |
|
519 | 519 | ->setNamespace($moduleNamespace) |
520 | 520 | ->setSegments($moduleSegments) |
521 | 521 | ->setParentSegments($moduleParentSegments) |
@@ -677,8 +677,8 @@ discard block |
||
677 | 677 | $segment = dash($segment); |
678 | 678 | |
679 | 679 | if ($this->exists($segment)) { |
680 | - if ($this->registry[ $segment ] instanceof DataStructures\Module) { |
|
681 | - return $this->registry[ $segment ]; |
|
680 | + if ($this->registry[$segment] instanceof DataStructures\Module) { |
|
681 | + return $this->registry[$segment]; |
|
682 | 682 | } |
683 | 683 | } |
684 | 684 | |
@@ -714,8 +714,8 @@ discard block |
||
714 | 714 | */ |
715 | 715 | public function first() |
716 | 716 | { |
717 | - if (isset($this->registry[ '' ])) { |
|
718 | - return $this->registry[ '' ]; |
|
717 | + if (isset($this->registry[''])) { |
|
718 | + return $this->registry['']; |
|
719 | 719 | } elseif (reset($this->registry)->type === 'APP') { |
720 | 720 | return reset($this->registry); |
721 | 721 | } |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | $segments = (is_array($segments) ? implode('/', array_map('dash', $segments)) : $segments); |
738 | 738 | |
739 | 739 | if ($this->exists($segments)) { |
740 | - return $this->registry[ $segments ]; |
|
740 | + return $this->registry[$segments]; |
|
741 | 741 | } |
742 | 742 | |
743 | 743 | return false; |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | |
759 | 759 | foreach ($this as $key => $module) { |
760 | 760 | if ($module instanceof DataStructures\Module) { |
761 | - $namespaces[ $key ] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
761 | + $namespaces[$key] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
762 | 762 | } |
763 | 763 | } |
764 | 764 |