@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | exit(EXIT_ERROR); |
101 | 101 | } |
102 | 102 | |
103 | - $jsonProperties[ 'name' ] = readable( |
|
103 | + $jsonProperties['name'] = readable( |
|
104 | 104 | pathinfo($modulePath, PATHINFO_FILENAME), |
105 | 105 | true |
106 | 106 | ); |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | ) . '\\'; |
114 | 114 | } else { |
115 | 115 | $namespace = $this->namespace; |
116 | - $jsonProperties[ 'namespace' ] = rtrim($namespace, '\\') . '\\'; |
|
116 | + $jsonProperties['namespace'] = rtrim($namespace, '\\') . '\\'; |
|
117 | 117 | } |
118 | 118 | |
119 | - $jsonProperties[ 'created' ] = date('d M Y'); |
|
119 | + $jsonProperties['created'] = date('d M Y'); |
|
120 | 120 | |
121 | 121 | loader()->addNamespace($namespace, $modulePath); |
122 | 122 |
@@ -101,12 +101,12 @@ |
||
101 | 101 | |
102 | 102 | mkdir($themePath . 'partials' . DIRECTORY_SEPARATOR, 0777, true); |
103 | 103 | |
104 | - $jsonProperties[ 'name' ] = readable( |
|
104 | + $jsonProperties['name'] = readable( |
|
105 | 105 | $this->optionName, |
106 | 106 | true |
107 | 107 | ); |
108 | 108 | |
109 | - $jsonProperties[ 'created' ] = date('d M Y'); |
|
109 | + $jsonProperties['created'] = date('d M Y'); |
|
110 | 110 | |
111 | 111 | file_put_contents($themePath . 'theme.json', json_encode($jsonProperties, JSON_PRETTY_PRINT)); |
112 | 112 |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | $properties = json_decode(file_get_contents($propFilePath), true); |
54 | 54 | |
55 | 55 | if (json_last_error() === JSON_ERROR_NONE) { |
56 | - if (isset($properties[ 'config' ])) { |
|
57 | - $this->presets = $properties[ 'presets' ]; |
|
58 | - unset($properties[ 'presets' ]); |
|
56 | + if (isset($properties['config'])) { |
|
57 | + $this->presets = $properties['presets']; |
|
58 | + unset($properties['presets']); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $this->properties = $properties; |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function getNamespace() |
138 | 138 | { |
139 | - if (isset($this->properties[ 'namespace' ])) { |
|
140 | - return $this->properties[ 'namespace' ]; |
|
139 | + if (isset($this->properties['namespace'])) { |
|
140 | + return $this->properties['namespace']; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | $dir = $this->getRealPath(); |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | $properties = json_decode(file_get_contents($propFilePath), true); |
62 | 62 | |
63 | 63 | if (json_last_error() === JSON_ERROR_NONE) { |
64 | - if (isset($properties[ 'config' ])) { |
|
65 | - $this->presets = $properties[ 'presets' ]; |
|
66 | - unset($properties[ 'presets' ]); |
|
64 | + if (isset($properties['config'])) { |
|
65 | + $this->presets = $properties['presets']; |
|
66 | + unset($properties['presets']); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | $this->properties = $properties; |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | { |
200 | 200 | $extensions = ['.php', '.phtml', '.html', '.tpl']; |
201 | 201 | |
202 | - if (isset($this->presets[ 'extensions' ])) { |
|
203 | - array_unshift($partialsExtensions, $this->presets[ 'extension' ]); |
|
204 | - } elseif (isset($this->presets[ 'extension' ])) { |
|
205 | - array_unshift($extensions, $this->presets[ 'extension' ]); |
|
202 | + if (isset($this->presets['extensions'])) { |
|
203 | + array_unshift($partialsExtensions, $this->presets['extension']); |
|
204 | + } elseif (isset($this->presets['extension'])) { |
|
205 | + array_unshift($extensions, $this->presets['extension']); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | foreach ($extensions as $extension) { |
@@ -283,7 +283,7 @@ |
||
283 | 283 | $themes = []; |
284 | 284 | foreach ($directory->getTree() as $themeName => $themeTree) { |
285 | 285 | if (($theme = $this->getTheme($themeName)) instanceof Module\Theme) { |
286 | - $themes[ $themeName ] = $theme; |
|
286 | + $themes[$themeName] = $theme; |
|
287 | 287 | } |
288 | 288 | } |
289 | 289 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | public function __construct() |
42 | 42 | { |
43 | 43 | if ($config = config()->loadFile('database', true)) { |
44 | - if ( ! empty($config[ 'default' ][ 'hostname' ]) AND ! empty($config[ 'default' ][ 'username' ])) { |
|
44 | + if ( ! empty($config['default']['hostname']) AND ! empty($config['default']['username'])) { |
|
45 | 45 | |
46 | 46 | if (profiler() !== false) { |
47 | 47 | profiler()->watch('Starting Database Service'); |
@@ -178,13 +178,13 @@ discard block |
||
178 | 178 | |
179 | 179 | if (isset($config) AND is_array($config)) { |
180 | 180 | // Set default timezone |
181 | - if (isset($config[ 'datetime' ][ 'timezone' ])) { |
|
182 | - date_default_timezone_set($config[ 'datetime' ][ 'timezone' ]); |
|
181 | + if (isset($config['datetime']['timezone'])) { |
|
182 | + date_default_timezone_set($config['datetime']['timezone']); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | // Setup Language Ideom and Locale |
186 | - if (isset($config[ 'language' ])) { |
|
187 | - language()->setDefault($config[ 'language' ]); |
|
186 | + if (isset($config['language'])) { |
|
187 | + language()->setDefault($config['language']); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | config()->merge($config); |
@@ -414,8 +414,8 @@ discard block |
||
414 | 414 | $packageJsonFile = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $packageJsonFile); |
415 | 415 | $packageJsonFileInfo = pathinfo($packageJsonFile); |
416 | 416 | |
417 | - if ($packageJsonFileInfo[ 'filename' ] === 'widget' or |
|
418 | - $packageJsonFileInfo[ 'filename' ] === 'language' or |
|
417 | + if ($packageJsonFileInfo['filename'] === 'widget' or |
|
418 | + $packageJsonFileInfo['filename'] === 'language' or |
|
419 | 419 | strpos($packageJsonFile, '.svn') !== false // subversion properties file conflict. |
420 | 420 | ) { |
421 | 421 | continue; |
@@ -445,8 +445,8 @@ discard block |
||
445 | 445 | } |
446 | 446 | |
447 | 447 | if (strpos($packageJsonFile, |
448 | - $modularType = ucfirst(plural($packageJsonFileInfo[ 'filename' ])) . DIRECTORY_SEPARATOR) === false) { |
|
449 | - $modularType = ucfirst($packageJsonFileInfo[ 'filename' ]) . DIRECTORY_SEPARATOR; |
|
448 | + $modularType = ucfirst(plural($packageJsonFileInfo['filename'])) . DIRECTORY_SEPARATOR) === false) { |
|
449 | + $modularType = ucfirst($packageJsonFileInfo['filename']) . DIRECTORY_SEPARATOR; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | $modularType = strtolower(rtrim($modularType, DIRECTORY_SEPARATOR)); |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | PATH_PUBLIC, |
462 | 462 | PATH_RESOURCES, |
463 | 463 | PATH_APP, |
464 | - $packageJsonFileInfo[ 'basename' ], |
|
464 | + $packageJsonFileInfo['basename'], |
|
465 | 465 | ucfirst($modularType) . DIRECTORY_SEPARATOR, |
466 | 466 | ], |
467 | 467 | '', |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | ) |
472 | 472 | ); |
473 | 473 | |
474 | - $moduleSegments = array_map(function ($string) { |
|
474 | + $moduleSegments = array_map(function($string) { |
|
475 | 475 | return dash(snakecase($string)); |
476 | 476 | }, $moduleSegments); |
477 | 477 | |
@@ -479,14 +479,14 @@ discard block |
||
479 | 479 | str_replace( |
480 | 480 | PATH_ROOT, |
481 | 481 | '', |
482 | - $packageJsonFileInfo[ 'dirname' ] |
|
482 | + $packageJsonFileInfo['dirname'] |
|
483 | 483 | ), |
484 | 484 | false |
485 | 485 | ); |
486 | 486 | |
487 | - if (isset($packageJsonMetadata[ 'namespace' ])) { |
|
488 | - $moduleNamespace = $packageJsonMetadata[ 'namespace' ]; |
|
489 | - unset($packageJsonMetadata[ 'namespace' ]); |
|
487 | + if (isset($packageJsonMetadata['namespace'])) { |
|
488 | + $moduleNamespace = $packageJsonMetadata['namespace']; |
|
489 | + unset($packageJsonMetadata['namespace']); |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | $moduleParentSegments = []; |
@@ -500,18 +500,18 @@ discard block |
||
500 | 500 | $registryKey = implode('/', $moduleSegments); |
501 | 501 | |
502 | 502 | if ($registryKey === '') { |
503 | - if ($packageJsonFileInfo[ 'dirname' ] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
503 | + if ($packageJsonFileInfo['dirname'] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
504 | 504 | $registryKey = dash(snakecase( |
505 | - pathinfo($packageJsonFileInfo[ 'dirname' ], PATHINFO_FILENAME))); |
|
505 | + pathinfo($packageJsonFileInfo['dirname'], PATHINFO_FILENAME))); |
|
506 | 506 | } |
507 | 507 | } else { |
508 | 508 | $registryKey = $registryKey; |
509 | 509 | } |
510 | 510 | |
511 | - $registry[ $registryKey ] = (new DataStructures\Module( |
|
512 | - $packageJsonFileInfo[ 'dirname' ] |
|
511 | + $registry[$registryKey] = (new DataStructures\Module( |
|
512 | + $packageJsonFileInfo['dirname'] |
|
513 | 513 | )) |
514 | - ->setType($packageJsonFileInfo[ 'filename' ]) |
|
514 | + ->setType($packageJsonFileInfo['filename']) |
|
515 | 515 | ->setNamespace($moduleNamespace) |
516 | 516 | ->setSegments($moduleSegments) |
517 | 517 | ->setParentSegments($moduleParentSegments) |
@@ -673,8 +673,8 @@ discard block |
||
673 | 673 | $segment = dash($segment); |
674 | 674 | |
675 | 675 | if ($this->exists($segment)) { |
676 | - if ($this->registry[ $segment ] instanceof DataStructures\Module) { |
|
677 | - return $this->registry[ $segment ]; |
|
676 | + if ($this->registry[$segment] instanceof DataStructures\Module) { |
|
677 | + return $this->registry[$segment]; |
|
678 | 678 | } |
679 | 679 | } |
680 | 680 | |
@@ -710,8 +710,8 @@ discard block |
||
710 | 710 | */ |
711 | 711 | public function first() |
712 | 712 | { |
713 | - if (isset($this->registry[ '' ])) { |
|
714 | - return $this->registry[ '' ]; |
|
713 | + if (isset($this->registry[''])) { |
|
714 | + return $this->registry['']; |
|
715 | 715 | } elseif (reset($this->registry)->type === 'APP') { |
716 | 716 | return reset($this->registry); |
717 | 717 | } |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | $segments = (is_array($segments) ? implode('/', array_map('dash', $segments)) : $segments); |
734 | 734 | |
735 | 735 | if ($this->exists($segments)) { |
736 | - return $this->registry[ $segments ]; |
|
736 | + return $this->registry[$segments]; |
|
737 | 737 | } |
738 | 738 | |
739 | 739 | return false; |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | |
755 | 755 | foreach ($this as $key => $module) { |
756 | 756 | if ($module instanceof DataStructures\Module) { |
757 | - $namespaces[ $key ] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
757 | + $namespaces[$key] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
758 | 758 | } |
759 | 759 | } |
760 | 760 |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function offsetExists($offset) |
105 | 105 | { |
106 | - return isset($GLOBALS[ $offset ]); |
|
106 | + return isset($GLOBALS[$offset]); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | // ------------------------------------------------------------------------ |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function &__get($offset) |
122 | 122 | { |
123 | - return $GLOBALS[ $offset ]; |
|
123 | + return $GLOBALS[$offset]; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | // ------------------------------------------------------------------------ |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function offsetSet($offset, $value) |
180 | 180 | { |
181 | - $GLOBALS[ $offset ] = $value; |
|
181 | + $GLOBALS[$offset] = $value; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | // ------------------------------------------------------------------------ |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function offsetUnset($offset) |
235 | 235 | { |
236 | - if (isset($GLOBALS[ $offset ])) { |
|
237 | - unset($GLOBALS[ $offset ]); |
|
236 | + if (isset($GLOBALS[$offset])) { |
|
237 | + unset($GLOBALS[$offset]); |
|
238 | 238 | } |
239 | 239 | } |
240 | 240 | |
@@ -435,6 +435,6 @@ discard block |
||
435 | 435 | */ |
436 | 436 | public function offsetGet($offset) |
437 | 437 | { |
438 | - return (isset($GLOBALS[ $offset ])) ? $GLOBALS[ $offset ] : false; |
|
438 | + return (isset($GLOBALS[$offset])) ? $GLOBALS[$offset] : false; |
|
439 | 439 | } |
440 | 440 | } |
441 | 441 | \ No newline at end of file |
@@ -45,7 +45,7 @@ |
||
45 | 45 | PATH_APP . 'Config' . DIRECTORY_SEPARATOR, |
46 | 46 | ]; |
47 | 47 | |
48 | - if(null !== o2system()->modules) { |
|
48 | + if (null !== o2system()->modules) { |
|
49 | 49 | $configDirs = modules()->getDirs('Config', true); |
50 | 50 | } |
51 | 51 |