@@ -85,11 +85,11 @@ |
||
| 85 | 85 | $subNamespace |
| 86 | 86 | )) . '\\'; |
| 87 | 87 | |
| 88 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 89 | - $vars[ 'NAMESPACE' ] = trim($classNamespace, '\\'); |
|
| 90 | - $vars[ 'PACKAGE' ] = '\\' . trim($classNamespace, '\\'); |
|
| 91 | - $vars[ 'CLASS' ] = $className; |
|
| 92 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 88 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 89 | + $vars['NAMESPACE'] = trim($classNamespace, '\\'); |
|
| 90 | + $vars['PACKAGE'] = '\\' . trim($classNamespace, '\\'); |
|
| 91 | + $vars['CLASS'] = $className; |
|
| 92 | + $vars['FILEPATH'] = $filePath; |
|
| 93 | 93 | |
| 94 | 94 | $phpTemplate = <<<PHPTEMPLATE |
| 95 | 95 | <?php |
@@ -72,13 +72,13 @@ |
||
| 72 | 72 | exit(EXIT_ERROR); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 76 | - $vars[ 'HELPER' ] = underscore( |
|
| 75 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 76 | + $vars['HELPER'] = underscore( |
|
| 77 | 77 | snakecase( |
| 78 | 78 | pathinfo($filePath, PATHINFO_FILENAME) |
| 79 | 79 | ) |
| 80 | 80 | ); |
| 81 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 81 | + $vars['FILEPATH'] = $filePath; |
|
| 82 | 82 | |
| 83 | 83 | $phpTemplate = <<<PHPTEMPLATE |
| 84 | 84 | <?php |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function optionName($name) |
| 40 | 40 | { |
| 41 | - if(empty($this->optionPath)) { |
|
| 41 | + if (empty($this->optionPath)) { |
|
| 42 | 42 | $this->optionPath = PATH_PUBLIC . 'themes' . DIRECTORY_SEPARATOR; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -78,18 +78,18 @@ discard block |
||
| 78 | 78 | // Make default structure |
| 79 | 79 | mkdir($themePath . 'assets' . DIRECTORY_SEPARATOR, 0777, true); |
| 80 | 80 | |
| 81 | - foreach(['css','js', 'img', 'fonts', 'media', 'packages'] as $assetsDir) { |
|
| 81 | + foreach (['css', 'js', 'img', 'fonts', 'media', 'packages'] as $assetsDir) { |
|
| 82 | 82 | mkdir($themePath . 'assets' . DIRECTORY_SEPARATOR . $assetsDir . DIRECTORY_SEPARATOR, 0777, true); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | mkdir($themePath . 'partials' . DIRECTORY_SEPARATOR, 0777, true); |
| 86 | 86 | |
| 87 | - $jsProps[ 'name' ] = readable( |
|
| 87 | + $jsProps['name'] = readable( |
|
| 88 | 88 | $this->optionName, |
| 89 | 89 | true |
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | - $jsProps[ 'created' ] = date('d M Y'); |
|
| 92 | + $jsProps['created'] = date('d M Y'); |
|
| 93 | 93 | |
| 94 | 94 | file_put_contents($themePath . 'theme.jsprop', json_encode($jsProps, JSON_PRETTY_PRINT)); |
| 95 | 95 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | </html> |
| 111 | 111 | THEME; |
| 112 | 112 | |
| 113 | - file_put_contents($themePath . 'theme.phtml', str_replace('@','$',$themeTemplate)); |
|
| 113 | + file_put_contents($themePath . 'theme.phtml', str_replace('@', '$', $themeTemplate)); |
|
| 114 | 114 | |
| 115 | 115 | if (is_dir($themePath)) { |
| 116 | 116 | output()->write( |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | exit(EXIT_ERROR); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - $jsProps[ 'name' ] = readable( |
|
| 71 | + $jsProps['name'] = readable( |
|
| 72 | 72 | pathinfo($widgetPath, PATHINFO_FILENAME), |
| 73 | 73 | true |
| 74 | 74 | ); |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | ) . '\\'; |
| 82 | 82 | } else { |
| 83 | 83 | $namespace = prepare_class_name($this->namespace); |
| 84 | - $jsProps[ 'namespace' ] = rtrim($namespace, '\\') . '\\'; |
|
| 84 | + $jsProps['namespace'] = rtrim($namespace, '\\') . '\\'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $jsProps[ 'created' ] = date('d M Y'); |
|
| 87 | + $jsProps['created'] = date('d M Y'); |
|
| 88 | 88 | |
| 89 | 89 | loader()->addNamespace($namespace, $widgetPath); |
| 90 | 90 | |
@@ -72,9 +72,9 @@ |
||
| 72 | 72 | exit(EXIT_ERROR); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 76 | - $vars[ 'CONFIG' ] = '$' . camelcase(pathinfo($filePath, PATHINFO_FILENAME)); |
|
| 77 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 75 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 76 | + $vars['CONFIG'] = '$' . camelcase(pathinfo($filePath, PATHINFO_FILENAME)); |
|
| 77 | + $vars['FILEPATH'] = $filePath; |
|
| 78 | 78 | |
| 79 | 79 | $phpTemplate = <<<PHPTEMPLATE |
| 80 | 80 | <?php |
@@ -85,11 +85,11 @@ |
||
| 85 | 85 | $subNamespace |
| 86 | 86 | )) . '\\'; |
| 87 | 87 | |
| 88 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 89 | - $vars[ 'NAMESPACE' ] = trim($classNamespace, '\\'); |
|
| 90 | - $vars[ 'PACKAGE' ] = '\\' . trim($classNamespace, '\\'); |
|
| 91 | - $vars[ 'CLASS' ] = $className; |
|
| 92 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 88 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 89 | + $vars['NAMESPACE'] = trim($classNamespace, '\\'); |
|
| 90 | + $vars['PACKAGE'] = '\\' . trim($classNamespace, '\\'); |
|
| 91 | + $vars['CLASS'] = $className; |
|
| 92 | + $vars['FILEPATH'] = $filePath; |
|
| 93 | 93 | |
| 94 | 94 | $phpTemplate = <<<PHPTEMPLATE |
| 95 | 95 | <?php |
@@ -151,16 +151,16 @@ discard block |
||
| 151 | 151 | $options = input()->get(); |
| 152 | 152 | |
| 153 | 153 | if (empty($options)) { |
| 154 | - $_GET[ 'switch' ] = 'ON'; |
|
| 155 | - $_GET[ 'mode' ] = 'default'; |
|
| 156 | - $_GET[ 'lifetime' ] = 300; |
|
| 157 | - $_GET[ 'title' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 158 | - $_GET[ 'message' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 154 | + $_GET['switch'] = 'ON'; |
|
| 155 | + $_GET['mode'] = 'default'; |
|
| 156 | + $_GET['lifetime'] = 300; |
|
| 157 | + $_GET['title'] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 158 | + $_GET['message'] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 159 | 159 | } else { |
| 160 | - $_GET[ 'mode' ] = 'default'; |
|
| 161 | - $_GET[ 'lifetime' ] = 300; |
|
| 162 | - $_GET[ 'title' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 163 | - $_GET[ 'message' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 160 | + $_GET['mode'] = 'default'; |
|
| 161 | + $_GET['lifetime'] = 300; |
|
| 162 | + $_GET['title'] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 163 | + $_GET['message'] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | parent::execute(); |
@@ -173,11 +173,11 @@ discard block |
||
| 173 | 173 | (new Format()) |
| 174 | 174 | ->setContextualClass(Format::DANGER) |
| 175 | 175 | ->setString(language()->getLine('CLI_MAINTENANCE_ALREADY_STARTED', [ |
| 176 | - $maintenanceInfo[ 'mode' ], |
|
| 177 | - $maintenanceInfo[ 'datetime' ], |
|
| 178 | - date('r', strtotime($maintenanceInfo[ 'datetime' ]) + $maintenanceInfo[ 'lifetime' ]), |
|
| 179 | - $maintenanceInfo[ 'title' ], |
|
| 180 | - $maintenanceInfo[ 'message' ], |
|
| 176 | + $maintenanceInfo['mode'], |
|
| 177 | + $maintenanceInfo['datetime'], |
|
| 178 | + date('r', strtotime($maintenanceInfo['datetime']) + $maintenanceInfo['lifetime']), |
|
| 179 | + $maintenanceInfo['title'], |
|
| 180 | + $maintenanceInfo['message'], |
|
| 181 | 181 | ])) |
| 182 | 182 | ->setNewLinesAfter(1) |
| 183 | 183 | ); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | public function &__get($property) |
| 25 | 25 | { |
| 26 | - $get[ $property ] = false; |
|
| 26 | + $get[$property] = false; |
|
| 27 | 27 | |
| 28 | 28 | // CodeIgniter property aliasing |
| 29 | 29 | if ($property === 'load') { |
@@ -38,6 +38,6 @@ discard block |
||
| 38 | 38 | return models('controller'); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - return $get[ $property ]; |
|
| 41 | + return $get[$property]; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | \ No newline at end of file |
@@ -187,13 +187,13 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | if (isset($config) AND is_array($config)) { |
| 189 | 189 | // Set default timezone |
| 190 | - if (isset($config[ 'datetime' ][ 'timezone' ])) { |
|
| 191 | - date_default_timezone_set($config[ 'datetime' ][ 'timezone' ]); |
|
| 190 | + if (isset($config['datetime']['timezone'])) { |
|
| 191 | + date_default_timezone_set($config['datetime']['timezone']); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | // Setup Language Ideom and Locale |
| 195 | - if (isset($config[ 'language' ])) { |
|
| 196 | - language()->setDefault($config[ 'language' ]); |
|
| 195 | + if (isset($config['language'])) { |
|
| 196 | + language()->setDefault($config['language']); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | config()->merge($config); |
@@ -410,8 +410,8 @@ discard block |
||
| 410 | 410 | $propertiesFile = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $propertiesFile); |
| 411 | 411 | $propertiesFileInfo = pathinfo($propertiesFile); |
| 412 | 412 | |
| 413 | - if ($propertiesFileInfo[ 'filename' ] === 'widget' or |
|
| 414 | - $propertiesFileInfo[ 'filename' ] === 'language' or |
|
| 413 | + if ($propertiesFileInfo['filename'] === 'widget' or |
|
| 414 | + $propertiesFileInfo['filename'] === 'language' or |
|
| 415 | 415 | strpos($propertiesFile, '.svn') !== false // subversion properties file conflict. |
| 416 | 416 | ) { |
| 417 | 417 | continue; |
@@ -436,12 +436,12 @@ discard block |
||
| 436 | 436 | ->setIndent(2) |
| 437 | 437 | ->setNewLinesAfter(1) |
| 438 | 438 | ); |
| 439 | - } elseif( ! is_array($propertiesMetadata) ) { |
|
| 439 | + } elseif ( ! is_array($propertiesMetadata)) { |
|
| 440 | 440 | continue; |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | - if(strpos($propertiesFile, $modularType = ucfirst(plural($propertiesFileInfo[ 'filename' ])) . DIRECTORY_SEPARATOR) === false) { |
|
| 444 | - $modularType = ucfirst($propertiesFileInfo[ 'filename' ]) . DIRECTORY_SEPARATOR; |
|
| 443 | + if (strpos($propertiesFile, $modularType = ucfirst(plural($propertiesFileInfo['filename'])) . DIRECTORY_SEPARATOR) === false) { |
|
| 444 | + $modularType = ucfirst($propertiesFileInfo['filename']) . DIRECTORY_SEPARATOR; |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | $modularType = strtolower(rtrim($modularType, DIRECTORY_SEPARATOR)); |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | PATH_FRAMEWORK, |
| 456 | 456 | PATH_PUBLIC, |
| 457 | 457 | PATH_APP, |
| 458 | - $propertiesFileInfo[ 'basename' ], |
|
| 458 | + $propertiesFileInfo['basename'], |
|
| 459 | 459 | ucfirst($modularType) . DIRECTORY_SEPARATOR, |
| 460 | 460 | ], |
| 461 | 461 | '', |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | ) |
| 466 | 466 | ); |
| 467 | 467 | |
| 468 | - $moduleSegments = array_map(function ($string) { |
|
| 468 | + $moduleSegments = array_map(function($string) { |
|
| 469 | 469 | return dash(snakecase($string)); |
| 470 | 470 | }, $moduleSegments); |
| 471 | 471 | |
@@ -473,14 +473,14 @@ discard block |
||
| 473 | 473 | str_replace( |
| 474 | 474 | PATH_ROOT, |
| 475 | 475 | '', |
| 476 | - $propertiesFileInfo[ 'dirname' ] |
|
| 476 | + $propertiesFileInfo['dirname'] |
|
| 477 | 477 | ), |
| 478 | 478 | false |
| 479 | 479 | ); |
| 480 | 480 | |
| 481 | - if (isset($propertiesMetadata[ 'namespace' ])) { |
|
| 482 | - $moduleNamespace = $propertiesMetadata[ 'namespace' ]; |
|
| 483 | - unset($propertiesMetadata[ 'namespace' ]); |
|
| 481 | + if (isset($propertiesMetadata['namespace'])) { |
|
| 482 | + $moduleNamespace = $propertiesMetadata['namespace']; |
|
| 483 | + unset($propertiesMetadata['namespace']); |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | $moduleParentSegments = []; |
@@ -494,18 +494,18 @@ discard block |
||
| 494 | 494 | $registryKey = implode('/', $moduleSegments); |
| 495 | 495 | |
| 496 | 496 | if ($registryKey === '') { |
| 497 | - if ($propertiesFileInfo[ 'dirname' ] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
| 497 | + if ($propertiesFileInfo['dirname'] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
| 498 | 498 | $registryKey = dash(snakecase( |
| 499 | - pathinfo($propertiesFileInfo[ 'dirname' ], PATHINFO_FILENAME))); |
|
| 499 | + pathinfo($propertiesFileInfo['dirname'], PATHINFO_FILENAME))); |
|
| 500 | 500 | } |
| 501 | 501 | } else { |
| 502 | 502 | $registryKey = $registryKey; |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | - $datastructures[ $registryKey ] = (new Datastructures\Module( |
|
| 506 | - $propertiesFileInfo[ 'dirname' ] |
|
| 505 | + $datastructures[$registryKey] = (new Datastructures\Module( |
|
| 506 | + $propertiesFileInfo['dirname'] |
|
| 507 | 507 | )) |
| 508 | - ->setType($propertiesFileInfo[ 'filename' ]) |
|
| 508 | + ->setType($propertiesFileInfo['filename']) |
|
| 509 | 509 | ->setNamespace($moduleNamespace) |
| 510 | 510 | ->setSegments($moduleSegments) |
| 511 | 511 | ->setParentSegments($moduleParentSegments) |
@@ -666,8 +666,8 @@ discard block |
||
| 666 | 666 | $segment = dash($segment); |
| 667 | 667 | |
| 668 | 668 | if ($this->exists($segment)) { |
| 669 | - if ($this->registry[ $segment ] instanceof Datastructures\Module) { |
|
| 670 | - return $this->registry[ $segment ]; |
|
| 669 | + if ($this->registry[$segment] instanceof Datastructures\Module) { |
|
| 670 | + return $this->registry[$segment]; |
|
| 671 | 671 | } |
| 672 | 672 | } |
| 673 | 673 | |
@@ -692,8 +692,8 @@ discard block |
||
| 692 | 692 | |
| 693 | 693 | public function first() |
| 694 | 694 | { |
| 695 | - if (isset($this->registry[ '' ])) { |
|
| 696 | - return $this->registry[ '' ]; |
|
| 695 | + if (isset($this->registry[''])) { |
|
| 696 | + return $this->registry['']; |
|
| 697 | 697 | } elseif (reset($this->registry)->type === 'APP') { |
| 698 | 698 | return reset($this->registry); |
| 699 | 699 | } |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | $segments = (is_array($segments) ? implode('/', array_map('dash', $segments)) : $segments); |
| 716 | 716 | |
| 717 | 717 | if ($this->exists($segments)) { |
| 718 | - return $this->registry[ $segments ]; |
|
| 718 | + return $this->registry[$segments]; |
|
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | return false; |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | |
| 737 | 737 | foreach ($this as $key => $module) { |
| 738 | 738 | if ($module instanceof Datastructures\Module) { |
| 739 | - $namespaces[ $key ] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
| 739 | + $namespaces[$key] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
| 740 | 740 | } |
| 741 | 741 | } |
| 742 | 742 | |