@@ -173,7 +173,7 @@ |
||
173 | 173 | $phar->buildFromIterator(new \RecursiveIteratorIterator(new \RecursiveCallbackFilterIterator( |
174 | 174 | new \RecursiveDirectoryIterator(PATH_ROOT, |
175 | 175 | \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), |
176 | - function ($current, $key, $iterator) { |
|
176 | + function($current, $key, $iterator) { |
|
177 | 177 | if ($current->isDir()) { |
178 | 178 | // exclude build directory |
179 | 179 | if ($current->getFilename() === 'build') { |
@@ -191,16 +191,16 @@ discard block |
||
191 | 191 | $options = input()->get(); |
192 | 192 | |
193 | 193 | if (empty($options)) { |
194 | - $_GET[ 'switch' ] = 'ON'; |
|
195 | - $_GET[ 'mode' ] = 'default'; |
|
196 | - $_GET[ 'lifetime' ] = 300; |
|
197 | - $_GET[ 'title' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
198 | - $_GET[ 'message' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
194 | + $_GET['switch'] = 'ON'; |
|
195 | + $_GET['mode'] = 'default'; |
|
196 | + $_GET['lifetime'] = 300; |
|
197 | + $_GET['title'] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
198 | + $_GET['message'] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
199 | 199 | } else { |
200 | - $_GET[ 'mode' ] = 'default'; |
|
201 | - $_GET[ 'lifetime' ] = 300; |
|
202 | - $_GET[ 'title' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
203 | - $_GET[ 'message' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
200 | + $_GET['mode'] = 'default'; |
|
201 | + $_GET['lifetime'] = 300; |
|
202 | + $_GET['title'] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
203 | + $_GET['message'] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | $this->__callOptions(); |
@@ -213,11 +213,11 @@ discard block |
||
213 | 213 | (new Format()) |
214 | 214 | ->setContextualClass(Format::DANGER) |
215 | 215 | ->setString(language()->getLine('CLI_MAINTENANCE_ALREADY_STARTED', [ |
216 | - $maintenanceInfo[ 'mode' ], |
|
217 | - $maintenanceInfo[ 'datetime' ], |
|
218 | - date('r', strtotime($maintenanceInfo[ 'datetime' ]) + $maintenanceInfo[ 'lifetime' ]), |
|
219 | - $maintenanceInfo[ 'title' ], |
|
220 | - $maintenanceInfo[ 'message' ], |
|
216 | + $maintenanceInfo['mode'], |
|
217 | + $maintenanceInfo['datetime'], |
|
218 | + date('r', strtotime($maintenanceInfo['datetime']) + $maintenanceInfo['lifetime']), |
|
219 | + $maintenanceInfo['title'], |
|
220 | + $maintenanceInfo['message'], |
|
221 | 221 | ])) |
222 | 222 | ->setNewLinesAfter(1) |
223 | 223 | ); |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | $options = input()->get(); |
114 | 114 | |
115 | 115 | if (empty($options)) { |
116 | - $_GET[ 'host' ] = 'localhost'; |
|
117 | - $_GET[ 'port' ] = 8000; |
|
116 | + $_GET['host'] = 'localhost'; |
|
117 | + $_GET['port'] = 8000; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | $this->__callOptions(); |
@@ -126,12 +126,12 @@ discard block |
||
126 | 126 | ->setNewLinesAfter(1) |
127 | 127 | ); |
128 | 128 | |
129 | - $_SERVER[ 'DOCUMENT_ROOT' ] = PATH_PUBLIC; |
|
129 | + $_SERVER['DOCUMENT_ROOT'] = PATH_PUBLIC; |
|
130 | 130 | |
131 | 131 | output()->write( |
132 | 132 | (new Format()) |
133 | 133 | ->setContextualClass(Format::INFO) |
134 | - ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER[ 'DOCUMENT_ROOT' ]])) |
|
134 | + ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER['DOCUMENT_ROOT']])) |
|
135 | 135 | ->setNewLinesAfter(1) |
136 | 136 | ); |
137 | 137 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $directory = new \RecursiveIteratorIterator(new \RecursiveCallbackFilterIterator( |
97 | 97 | new \RecursiveDirectoryIterator(PATH_ROOT, |
98 | 98 | \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), |
99 | - function ($current, $key, $iterator) { |
|
99 | + function($current, $key, $iterator) { |
|
100 | 100 | if ($current->isDir()) { |
101 | 101 | // exclude build directory |
102 | 102 | if (in_array($current->getFilename(), [ |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | $files[] = $packageJsonFileInfo; |
120 | 120 | |
121 | - if ($packageJsonFileInfo[ 'filename' ] === 'language') { |
|
121 | + if ($packageJsonFileInfo['filename'] === 'language') { |
|
122 | 122 | if (is_cli()) { |
123 | 123 | output()->verbose( |
124 | 124 | (new Format()) |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | ); |
142 | 142 | } |
143 | 143 | |
144 | - $registry[ $package->getDirName() ] = $package; |
|
144 | + $registry[$package->getDirName()] = $package; |
|
145 | 145 | } elseif (is_cli()) { |
146 | 146 | output()->verbose( |
147 | 147 | (new Format()) |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | { |
186 | 186 | if (isset($package)) { |
187 | 187 | if ($this->registered($package)) { |
188 | - return $this->registry[ $package ]; |
|
188 | + return $this->registry[$package]; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | return false; |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function registered($package) |
207 | 207 | { |
208 | - return isset($this->registry[ $package ]); |
|
208 | + return isset($this->registry[$package]); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | // ------------------------------------------------------------------------ |
@@ -487,11 +487,11 @@ |
||
487 | 487 | $moduleParentSegments = []; |
488 | 488 | |
489 | 489 | foreach ([ |
490 | - 'apps', |
|
491 | - 'modules', |
|
492 | - 'components', |
|
493 | - 'plugins', |
|
494 | - ] as $moduleType |
|
490 | + 'apps', |
|
491 | + 'modules', |
|
492 | + 'components', |
|
493 | + 'plugins', |
|
494 | + ] as $moduleType |
|
495 | 495 | ) { |
496 | 496 | if (false !== ($segmentKey = array_search($modularType, $moduleSegments))) { |
497 | 497 | $moduleParentSegments = array_slice($moduleSegments, 0, $segmentKey); |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | |
204 | 204 | if (isset($config) AND is_array($config)) { |
205 | 205 | // Set default timezone |
206 | - if (isset($config[ 'datetime' ][ 'timezone' ])) { |
|
207 | - date_default_timezone_set($config[ 'datetime' ][ 'timezone' ]); |
|
206 | + if (isset($config['datetime']['timezone'])) { |
|
207 | + date_default_timezone_set($config['datetime']['timezone']); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | // Setup Language Ideom and Locale |
211 | - if (isset($config[ 'language' ])) { |
|
212 | - language()->setDefault($config[ 'language' ]); |
|
211 | + if (isset($config['language'])) { |
|
212 | + language()->setDefault($config['language']); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | config()->merge($config); |
@@ -372,14 +372,14 @@ discard block |
||
372 | 372 | public function push($module) |
373 | 373 | { |
374 | 374 | if ( ! in_array($module->getNamespace(), ['O2System\Kernel\\', 'O2System\Framework\\', 'App\\'])) { |
375 | - if($module instanceof DataStructures\Module) { |
|
375 | + if ($module instanceof DataStructures\Module) { |
|
376 | 376 | $this->autoload($module); |
377 | 377 | |
378 | 378 | parent::push($module); |
379 | 379 | |
380 | - if($module->getType() === 'APP') { |
|
380 | + if ($module->getType() === 'APP') { |
|
381 | 381 | $this->setActiveApp($module); |
382 | - } elseif(in_array($module->getType(), ['MODULE', 'COMPONENT'])) { |
|
382 | + } elseif (in_array($module->getType(), ['MODULE', 'COMPONENT'])) { |
|
383 | 383 | $this->setActiveModule($module); |
384 | 384 | } |
385 | 385 | } |
@@ -447,8 +447,8 @@ discard block |
||
447 | 447 | $packageJsonFile = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $packageJsonFile); |
448 | 448 | $packageJsonFileInfo = pathinfo($packageJsonFile); |
449 | 449 | |
450 | - if ($packageJsonFileInfo[ 'filename' ] === 'widget' or |
|
451 | - $packageJsonFileInfo[ 'filename' ] === 'language' or |
|
450 | + if ($packageJsonFileInfo['filename'] === 'widget' or |
|
451 | + $packageJsonFileInfo['filename'] === 'language' or |
|
452 | 452 | strpos($packageJsonFile, '.svn') !== false // subversion properties file conflict. |
453 | 453 | ) { |
454 | 454 | continue; |
@@ -478,8 +478,8 @@ discard block |
||
478 | 478 | } |
479 | 479 | |
480 | 480 | if (strpos($packageJsonFile, |
481 | - $modularType = ucfirst(plural($packageJsonFileInfo[ 'filename' ])) . DIRECTORY_SEPARATOR) === false) { |
|
482 | - $modularType = ucfirst($packageJsonFileInfo[ 'filename' ]) . DIRECTORY_SEPARATOR; |
|
481 | + $modularType = ucfirst(plural($packageJsonFileInfo['filename'])) . DIRECTORY_SEPARATOR) === false) { |
|
482 | + $modularType = ucfirst($packageJsonFileInfo['filename']) . DIRECTORY_SEPARATOR; |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | $modularType = strtolower(rtrim($modularType, DIRECTORY_SEPARATOR)); |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | PATH_PUBLIC, |
495 | 495 | PATH_RESOURCES, |
496 | 496 | PATH_APP, |
497 | - $packageJsonFileInfo[ 'basename' ], |
|
497 | + $packageJsonFileInfo['basename'], |
|
498 | 498 | ], |
499 | 499 | '', |
500 | 500 | $packageJsonFile |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | ) |
504 | 504 | ); |
505 | 505 | |
506 | - $moduleSegments = array_map(function ($string) { |
|
506 | + $moduleSegments = array_map(function($string) { |
|
507 | 507 | return dash(snakecase($string)); |
508 | 508 | }, $moduleSegments); |
509 | 509 | |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | if (false !== ($segmentKey = array_search($modularType, $moduleSegments))) { |
520 | 520 | $moduleParentSegments = array_slice($moduleSegments, 0, $segmentKey); |
521 | 521 | |
522 | - unset($moduleSegments[ $segmentKey ]); |
|
522 | + unset($moduleSegments[$segmentKey]); |
|
523 | 523 | break; |
524 | 524 | } |
525 | 525 | } |
@@ -530,29 +530,29 @@ discard block |
||
530 | 530 | str_replace( |
531 | 531 | PATH_ROOT, |
532 | 532 | '', |
533 | - $packageJsonFileInfo[ 'dirname' ] |
|
533 | + $packageJsonFileInfo['dirname'] |
|
534 | 534 | ), |
535 | 535 | false |
536 | 536 | ); |
537 | 537 | |
538 | - if (isset($packageJsonMetadata[ 'namespace' ])) { |
|
539 | - $moduleNamespace = $packageJsonMetadata[ 'namespace' ]; |
|
540 | - unset($packageJsonMetadata[ 'namespace' ]); |
|
538 | + if (isset($packageJsonMetadata['namespace'])) { |
|
539 | + $moduleNamespace = $packageJsonMetadata['namespace']; |
|
540 | + unset($packageJsonMetadata['namespace']); |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | $registryKey = implode('/', $moduleSegments); |
544 | 544 | |
545 | 545 | if ($registryKey === '') { |
546 | - if ($packageJsonFileInfo[ 'dirname' ] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
546 | + if ($packageJsonFileInfo['dirname'] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
547 | 547 | $registryKey = dash(snakecase( |
548 | - pathinfo($packageJsonFileInfo[ 'dirname' ], PATHINFO_FILENAME))); |
|
548 | + pathinfo($packageJsonFileInfo['dirname'], PATHINFO_FILENAME))); |
|
549 | 549 | } |
550 | 550 | } |
551 | 551 | |
552 | - $registry[ $registryKey ] = (new DataStructures\Module( |
|
553 | - $packageJsonFileInfo[ 'dirname' ] |
|
552 | + $registry[$registryKey] = (new DataStructures\Module( |
|
553 | + $packageJsonFileInfo['dirname'] |
|
554 | 554 | )) |
555 | - ->setType($packageJsonFileInfo[ 'filename' ]) |
|
555 | + ->setType($packageJsonFileInfo['filename']) |
|
556 | 556 | ->setNamespace($moduleNamespace) |
557 | 557 | ->setSegments($moduleSegments) |
558 | 558 | ->setParentSegments($moduleParentSegments) |
@@ -714,8 +714,8 @@ discard block |
||
714 | 714 | $segment = dash($segment); |
715 | 715 | |
716 | 716 | if ($this->exists($segment)) { |
717 | - if ($this->registry[ $segment ] instanceof DataStructures\Module) { |
|
718 | - return $this->registry[ $segment ]; |
|
717 | + if ($this->registry[$segment] instanceof DataStructures\Module) { |
|
718 | + return $this->registry[$segment]; |
|
719 | 719 | } |
720 | 720 | } |
721 | 721 | |
@@ -751,8 +751,8 @@ discard block |
||
751 | 751 | */ |
752 | 752 | public function first() |
753 | 753 | { |
754 | - if (isset($this->registry[ '' ])) { |
|
755 | - return $this->registry[ '' ]; |
|
754 | + if (isset($this->registry[''])) { |
|
755 | + return $this->registry['']; |
|
756 | 756 | } elseif (reset($this->registry)->type === 'APP') { |
757 | 757 | return reset($this->registry); |
758 | 758 | } |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | $segments = (is_array($segments) ? implode('/', array_map('dash', $segments)) : $segments); |
775 | 775 | |
776 | 776 | if ($this->exists($segments)) { |
777 | - return $this->registry[ $segments ]; |
|
777 | + return $this->registry[$segments]; |
|
778 | 778 | } |
779 | 779 | |
780 | 780 | return false; |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | |
796 | 796 | foreach ($this as $key => $module) { |
797 | 797 | if ($module instanceof DataStructures\Module) { |
798 | - $namespaces[ $key ] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
798 | + $namespaces[$key] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
799 | 799 | } |
800 | 800 | } |
801 | 801 |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function setProperties(array $properties) |
197 | 197 | { |
198 | - if (isset($properties[ 'presets' ])) { |
|
199 | - $this->setPresets($properties[ 'presets' ]); |
|
198 | + if (isset($properties['presets'])) { |
|
199 | + $this->setPresets($properties['presets']); |
|
200 | 200 | |
201 | - unset($properties[ 'presets' ]); |
|
201 | + unset($properties['presets']); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | $this->properties = $properties; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $themes = []; |
289 | 289 | foreach ($directory->getTree() as $themeName => $themeTree) { |
290 | 290 | if (($theme = $this->getTheme($themeName)) instanceof Module\Theme) { |
291 | - $themes[ $themeName ] = $theme; |
|
291 | + $themes[$themeName] = $theme; |
|
292 | 292 | } |
293 | 293 | } |
294 | 294 | |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | |
516 | 516 | if ( ! empty($controller->name) and ! in_array($controller->getParameter(), |
517 | 517 | ['login', 'pages', 'setup', 'license'])) { |
518 | - $controllers[ $controller->getParameter() ] = $controller; |
|
518 | + $controllers[$controller->getParameter()] = $controller; |
|
519 | 519 | } |
520 | 520 | } |
521 | 521 | } |
@@ -111,7 +111,7 @@ |
||
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
114 | - if(empty($this->methods) and $this->hasMethod('route')) { |
|
114 | + if (empty($this->methods) and $this->hasMethod('route')) { |
|
115 | 115 | $method = $this->getMethod('route'); |
116 | 116 | $method->segment = dash($method->name); |
117 | 117 | $method->segments = implode('/', $segments); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ]); |
86 | 86 | } |
87 | 87 | |
88 | - $update[ $this->primaryKey ] = $child->{$this->primaryKey}; |
|
88 | + $update[$this->primaryKey] = $child->{$this->primaryKey}; |
|
89 | 89 | |
90 | 90 | if ($this->qb |
91 | 91 | ->table($this->table) |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ->update($update = [ |
101 | 101 | 'record_right' => $right, |
102 | 102 | ]); |
103 | - $update[ $this->primaryKey ] = $child->{$this->primaryKey}; |
|
103 | + $update[$this->primaryKey] = $child->{$this->primaryKey}; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | $i++; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | ->select($this->table . '.*') |
257 | 257 | ->from($this->table) |
258 | 258 | ->from($this->table . ' AS node') |
259 | - ->whereBetween($this->table . '.record_left', [ 'node.record_left', 'node.record_right']) |
|
259 | + ->whereBetween($this->table . '.record_left', ['node.record_left', 'node.record_right']) |
|
260 | 260 | ->where([ |
261 | 261 | 'node.' . $this->primaryKey => $id, |
262 | 262 | $this->table . '.' . $this->primaryKey . '!=' => $id, |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | $properties = json_decode(file_get_contents($propFilePath), true); |
63 | 63 | |
64 | 64 | if (json_last_error() === JSON_ERROR_NONE) { |
65 | - if (isset($properties[ 'config' ])) { |
|
66 | - $this->presets = $properties[ 'presets' ]; |
|
67 | - unset($properties[ 'presets' ]); |
|
65 | + if (isset($properties['config'])) { |
|
66 | + $this->presets = $properties['presets']; |
|
67 | + unset($properties['presets']); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $this->properties = $properties; |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | { |
199 | 199 | $extensions = ['.php', '.phtml', '.html', '.tpl']; |
200 | 200 | |
201 | - if (isset($this->presets[ 'extensions' ])) { |
|
202 | - array_unshift($partialsExtensions, $this->presets[ 'extension' ]); |
|
203 | - } elseif (isset($this->presets[ 'extension' ])) { |
|
204 | - array_unshift($extensions, $this->presets[ 'extension' ]); |
|
201 | + if (isset($this->presets['extensions'])) { |
|
202 | + array_unshift($partialsExtensions, $this->presets['extension']); |
|
203 | + } elseif (isset($this->presets['extension'])) { |
|
204 | + array_unshift($extensions, $this->presets['extension']); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | $found = false; |
@@ -253,10 +253,10 @@ discard block |
||
253 | 253 | if (isset($layout)) { |
254 | 254 | $extensions = ['.php', '.phtml', '.html', '.tpl']; |
255 | 255 | |
256 | - if (isset($this->presets[ 'extensions' ])) { |
|
257 | - array_unshift($partialsExtensions, $this->presets[ 'extension' ]); |
|
258 | - } elseif (isset($this->presets[ 'extension' ])) { |
|
259 | - array_unshift($extensions, $this->presets[ 'extension' ]); |
|
256 | + if (isset($this->presets['extensions'])) { |
|
257 | + array_unshift($partialsExtensions, $this->presets['extension']); |
|
258 | + } elseif (isset($this->presets['extension'])) { |
|
259 | + array_unshift($extensions, $this->presets['extension']); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | foreach ($extensions as $extension) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | if ($this->layout instanceof Theme\Layout) { |
291 | 291 | |
292 | 292 | // load parent theme layout |
293 | - if($this->layout->getFilename() !== 'theme') { |
|
293 | + if ($this->layout->getFilename() !== 'theme') { |
|
294 | 294 | $themeLayout = $this->getLayout('theme'); |
295 | 295 | |
296 | 296 | // add theme layout public directory |