@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | // ------------------------------------------------------------------------ |
| 12 | 12 | |
| 13 | -if ( ! function_exists('o2system')) { |
|
| 13 | +if (!function_exists('o2system')) { |
|
| 14 | 14 | /** |
| 15 | 15 | * o2system |
| 16 | 16 | * |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | // ------------------------------------------------------------------------ |
| 28 | 28 | |
| 29 | -if ( ! function_exists('loader')) { |
|
| 29 | +if (!function_exists('loader')) { |
|
| 30 | 30 | /** |
| 31 | 31 | * loader |
| 32 | 32 | * |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | // ------------------------------------------------------------------------ |
| 44 | 44 | |
| 45 | -if ( ! function_exists('config')) { |
|
| 45 | +if (!function_exists('config')) { |
|
| 46 | 46 | /** |
| 47 | 47 | * config |
| 48 | 48 | * |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $args = func_get_args(); |
| 56 | 56 | |
| 57 | 57 | if ($countArgs = count($args)) { |
| 58 | - if(services()->has('config')) { |
|
| 58 | + if (services()->has('config')) { |
|
| 59 | 59 | $config = services('config'); |
| 60 | 60 | |
| 61 | 61 | if ($countArgs == 1) { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // ------------------------------------------------------------------------ |
| 74 | 74 | |
| 75 | -if ( ! function_exists('cache')) { |
|
| 75 | +if (!function_exists('cache')) { |
|
| 76 | 76 | /** |
| 77 | 77 | * cache |
| 78 | 78 | * |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | function cache() |
| 84 | 84 | { |
| 85 | - if(services()->has('cache')) { |
|
| 85 | + if (services()->has('cache')) { |
|
| 86 | 86 | return services()->get('cache'); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | // ------------------------------------------------------------------------ |
| 94 | 94 | |
| 95 | -if ( ! function_exists('hooks')) { |
|
| 95 | +if (!function_exists('hooks')) { |
|
| 96 | 96 | /** |
| 97 | 97 | * hooks |
| 98 | 98 | * |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | function hooks() |
| 104 | 104 | { |
| 105 | - if(services()->has('hooks')) { |
|
| 105 | + if (services()->has('hooks')) { |
|
| 106 | 106 | return services()->get('hooks'); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // ------------------------------------------------------------------------ |
| 114 | 114 | |
| 115 | -if ( ! function_exists('database')) { |
|
| 115 | +if (!function_exists('database')) { |
|
| 116 | 116 | /** |
| 117 | 117 | * database |
| 118 | 118 | * |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | // ------------------------------------------------------------------------ |
| 130 | 130 | |
| 131 | -if ( ! function_exists('models')) { |
|
| 131 | +if (!function_exists('models')) { |
|
| 132 | 132 | /** |
| 133 | 133 | * models |
| 134 | 134 | * |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $args = func_get_args(); |
| 142 | 142 | |
| 143 | 143 | if (count($args)) { |
| 144 | - return o2system()->models->get($args[ 0 ]); |
|
| 144 | + return o2system()->models->get($args[0]); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | return o2system()->models; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | // ------------------------------------------------------------------------ |
| 152 | 152 | |
| 153 | -if ( ! function_exists('router')) { |
|
| 153 | +if (!function_exists('router')) { |
|
| 154 | 154 | /** |
| 155 | 155 | * router |
| 156 | 156 | * |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | // ------------------------------------------------------------------------ |
| 168 | 168 | |
| 169 | -if ( ! function_exists('session')) { |
|
| 169 | +if (!function_exists('session')) { |
|
| 170 | 170 | /** |
| 171 | 171 | * session |
| 172 | 172 | * |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | $args = func_get_args(); |
| 180 | 180 | |
| 181 | 181 | if (count($args)) { |
| 182 | - if(isset($_SESSION[ $args[0] ])) { |
|
| 183 | - return $_SESSION[ $args[0] ]; |
|
| 182 | + if (isset($_SESSION[$args[0]])) { |
|
| 183 | + return $_SESSION[$args[0]]; |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | return null; |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | // ------------------------------------------------------------------------ |
| 194 | 194 | |
| 195 | -if ( ! function_exists('middleware')) { |
|
| 195 | +if (!function_exists('middleware')) { |
|
| 196 | 196 | /** |
| 197 | 197 | * O2System |
| 198 | 198 | * |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | // ------------------------------------------------------------------------ |
| 210 | 210 | |
| 211 | -if ( ! function_exists('controller')) { |
|
| 211 | +if (!function_exists('controller')) { |
|
| 212 | 212 | /** |
| 213 | 213 | * controller |
| 214 | 214 | * |
@@ -140,23 +140,23 @@ discard block |
||
| 140 | 140 | $filename = pathinfo($filePath, PATHINFO_FILENAME); |
| 141 | 141 | |
| 142 | 142 | // Get model class directory name |
| 143 | - $dirName = dirname($filePath) . DIRECTORY_SEPARATOR; |
|
| 143 | + $dirName = dirname($filePath).DIRECTORY_SEPARATOR; |
|
| 144 | 144 | |
| 145 | 145 | if ($filename === 'Model') { |
| 146 | - $subModelsDirName = dirname($dirName) . DIRECTORY_SEPARATOR . 'Models' . DIRECTORY_SEPARATOR; |
|
| 146 | + $subModelsDirName = dirname($dirName).DIRECTORY_SEPARATOR.'Models'.DIRECTORY_SEPARATOR; |
|
| 147 | 147 | |
| 148 | 148 | if (is_dir($subModelsDirName)) { |
| 149 | 149 | $subModelPath = $subModelsDirName; |
| 150 | 150 | } |
| 151 | - } elseif (is_dir($subModelsDirName = $dirName . $filename . DIRECTORY_SEPARATOR)) { |
|
| 151 | + } elseif (is_dir($subModelsDirName = $dirName.$filename.DIRECTORY_SEPARATOR)) { |
|
| 152 | 152 | $subModelPath = $subModelsDirName; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if (isset($subModelPath)) { |
| 156 | 156 | loader()->addNamespace($reflection->name, $subModelPath); |
| 157 | 157 | |
| 158 | - foreach (glob($subModelPath . '*.php') as $filepath) { |
|
| 159 | - $this->validSubModels[ strtolower(pathinfo($filepath, PATHINFO_FILENAME)) ] = $filepath; |
|
| 158 | + foreach (glob($subModelPath.'*.php') as $filepath) { |
|
| 159 | + $this->validSubModels[strtolower(pathinfo($filepath, PATHINFO_FILENAME))] = $filepath; |
|
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | } |
@@ -183,25 +183,25 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | public function &__get($property) |
| 185 | 185 | { |
| 186 | - $get[ $property ] = false; |
|
| 186 | + $get[$property] = false; |
|
| 187 | 187 | |
| 188 | 188 | if (services()->has($property)) { |
| 189 | - $get[ $property ] = services()->get($property); |
|
| 189 | + $get[$property] = services()->get($property); |
|
| 190 | 190 | } elseif (array_key_exists($property, $this->validSubModels)) { |
| 191 | - $get[ $property ] = $this->loadSubModel($property); |
|
| 191 | + $get[$property] = $this->loadSubModel($property); |
|
| 192 | 192 | } elseif (o2system()->__isset($property)) { |
| 193 | - $get[ $property ] = o2system()->__get($property); |
|
| 193 | + $get[$property] = o2system()->__get($property); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - return $get[ $property ]; |
|
| 196 | + return $get[$property]; |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | // ------------------------------------------------------------------------ |
| 200 | 200 | |
| 201 | 201 | final protected function loadSubModel($model) |
| 202 | 202 | { |
| 203 | - if (is_file($this->validSubModels[ $model ])) { |
|
| 204 | - $className = '\\' . get_called_class() . '\\' . ucfirst($model); |
|
| 203 | + if (is_file($this->validSubModels[$model])) { |
|
| 204 | + $className = '\\'.get_called_class().'\\'.ucfirst($model); |
|
| 205 | 205 | $className = str_replace('\Base\\Model', '\Models', $className); |
| 206 | 206 | |
| 207 | 207 | if (class_exists($className)) { |
@@ -143,27 +143,27 @@ discard block |
||
| 143 | 143 | $filename = pathinfo($filePath, PATHINFO_FILENAME); |
| 144 | 144 | |
| 145 | 145 | // Get model class directory name |
| 146 | - $dirName = dirname($filePath) . DIRECTORY_SEPARATOR; |
|
| 146 | + $dirName = dirname($filePath).DIRECTORY_SEPARATOR; |
|
| 147 | 147 | |
| 148 | 148 | // Get sub models or siblings models |
| 149 | 149 | if ($filename === 'Model' || $filename === modules()->current()->getDirName()) { |
| 150 | - $subModelsDirName = dirname($dirName) . DIRECTORY_SEPARATOR . 'Models' . DIRECTORY_SEPARATOR; |
|
| 150 | + $subModelsDirName = dirname($dirName).DIRECTORY_SEPARATOR.'Models'.DIRECTORY_SEPARATOR; |
|
| 151 | 151 | |
| 152 | 152 | if (is_dir($subModelsDirName)) { |
| 153 | 153 | $subModelPath = $subModelsDirName; |
| 154 | 154 | } |
| 155 | - } elseif (is_dir($subModelsDirName = $dirName . $filename . DIRECTORY_SEPARATOR)) { |
|
| 155 | + } elseif (is_dir($subModelsDirName = $dirName.$filename.DIRECTORY_SEPARATOR)) { |
|
| 156 | 156 | $subModelPath = $subModelsDirName; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | if (isset($subModelPath)) { |
| 160 | 160 | loader()->addNamespace($reflection->name, $subModelPath); |
| 161 | 161 | |
| 162 | - foreach (glob($subModelPath . '*.php') as $filepath) { |
|
| 162 | + foreach (glob($subModelPath.'*.php') as $filepath) { |
|
| 163 | 163 | if ($filepath === $filePath) { |
| 164 | 164 | continue; |
| 165 | 165 | } |
| 166 | - $this->validSubModels[ camelcase(pathinfo($filepath, PATHINFO_FILENAME)) ] = $filepath; |
|
| 166 | + $this->validSubModels[camelcase(pathinfo($filepath, PATHINFO_FILENAME))] = $filepath; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | $modelClassName = get_called_class(); |
| 176 | 176 | |
| 177 | - if ( ! models()->has($modelClassName)) { |
|
| 177 | + if (!models()->has($modelClassName)) { |
|
| 178 | 178 | models()->load($modelClassName, $modelClassName); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - if (empty($get[ $property ])) { |
|
| 213 | + if (empty($get[$property])) { |
|
| 214 | 214 | if (services()->has($property)) { |
| 215 | 215 | return services()->get($property); |
| 216 | 216 | } elseif ($this->hasSubModel($property)) { |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | { |
| 230 | 230 | if ($this->hasSubModel($model)) { |
| 231 | 231 | $classNames = [ |
| 232 | - '\\' . get_called_class() . '\\' . ucfirst($model), |
|
| 233 | - '\\' . get_namespace(get_called_class()) . ucfirst($model), |
|
| 232 | + '\\'.get_called_class().'\\'.ucfirst($model), |
|
| 233 | + '\\'.get_namespace(get_called_class()).ucfirst($model), |
|
| 234 | 234 | ]; |
| 235 | 235 | |
| 236 | 236 | foreach ($classNames as $className) { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | final protected function hasSubModel($model) |
| 252 | 252 | { |
| 253 | 253 | if (array_key_exists($model, $this->validSubModels)) { |
| 254 | - return (bool)is_file($this->validSubModels[ $model ]); |
|
| 254 | + return (bool) is_file($this->validSubModels[$model]); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | return false; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | public function &__get($property) |
| 26 | 26 | { |
| 27 | - $get[ $property ] = false; |
|
| 27 | + $get[$property] = false; |
|
| 28 | 28 | |
| 29 | 29 | // CodeIgniter property aliasing |
| 30 | 30 | if ($property === 'load') { |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | if (services()->has($property)) { |
| 35 | - $get[ $property ] = services()->get($property); |
|
| 35 | + $get[$property] = services()->get($property); |
|
| 36 | 36 | } elseif (o2system()->__isset($property)) { |
| 37 | - $get[ $property ] = o2system()->__get($property); |
|
| 37 | + $get[$property] = o2system()->__get($property); |
|
| 38 | 38 | } elseif ($property === 'model') { |
| 39 | - $get[ $property ] = models('controller'); |
|
| 39 | + $get[$property] = models('controller'); |
|
| 40 | 40 | } elseif ($property === 'services' || $property === 'libraries') { |
| 41 | - $get[ $property ] = services(); |
|
| 41 | + $get[$property] = services(); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - return $get[ $property ]; |
|
| 44 | + return $get[$property]; |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | \ No newline at end of file |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * WITH TRAILING SLASH! |
| 50 | 50 | */ |
| 51 | -if ( ! defined('PATH_VENDOR')) { |
|
| 52 | - define('PATH_VENDOR', PATH_ROOT . 'vendor' . DIRECTORY_SEPARATOR); |
|
| 51 | +if (!defined('PATH_VENDOR')) { |
|
| 52 | + define('PATH_VENDOR', PATH_ROOT.'vendor'.DIRECTORY_SEPARATOR); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /* |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | * |
| 62 | 62 | * WITH TRAILING SLASH! |
| 63 | 63 | */ |
| 64 | -if ( ! defined('PATH_REACTOR')) { |
|
| 65 | - define('PATH_REACTOR', __DIR__ . DIRECTORY_SEPARATOR); |
|
| 64 | +if (!defined('PATH_REACTOR')) { |
|
| 65 | + define('PATH_REACTOR', __DIR__.DIRECTORY_SEPARATOR); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /* |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * WITH TRAILING SLASH! |
| 76 | 76 | */ |
| 77 | -if ( ! defined('PATH_APP')) { |
|
| 78 | - define('PATH_APP', PATH_ROOT . DIR_APP . DIRECTORY_SEPARATOR); |
|
| 77 | +if (!defined('PATH_APP')) { |
|
| 78 | + define('PATH_APP', PATH_ROOT.DIR_APP.DIRECTORY_SEPARATOR); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /* |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | * |
| 88 | 88 | * WITH TRAILING SLASH! |
| 89 | 89 | */ |
| 90 | -if ( ! defined('PATH_PUBLIC')) { |
|
| 91 | - define('PATH_PUBLIC', PATH_ROOT . DIR_PUBLIC . DIRECTORY_SEPARATOR); |
|
| 90 | +if (!defined('PATH_PUBLIC')) { |
|
| 91 | + define('PATH_PUBLIC', PATH_ROOT.DIR_PUBLIC.DIRECTORY_SEPARATOR); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /* |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | * |
| 101 | 101 | * WITH TRAILING SLASH! |
| 102 | 102 | */ |
| 103 | -if ( ! defined('PATH_CACHE')) { |
|
| 104 | - define('PATH_CACHE', PATH_ROOT . DIR_CACHE . DIRECTORY_SEPARATOR); |
|
| 103 | +if (!defined('PATH_CACHE')) { |
|
| 104 | + define('PATH_CACHE', PATH_ROOT.DIR_CACHE.DIRECTORY_SEPARATOR); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /* |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | * |
| 114 | 114 | * WITH TRAILING SLASH! |
| 115 | 115 | */ |
| 116 | -if ( ! defined('PATH_STORAGE')) { |
|
| 117 | - define('PATH_STORAGE', PATH_ROOT . DIR_STORAGE . DIRECTORY_SEPARATOR); |
|
| 116 | +if (!defined('PATH_STORAGE')) { |
|
| 117 | + define('PATH_STORAGE', PATH_ROOT.DIR_STORAGE.DIRECTORY_SEPARATOR); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /* |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | * |
| 127 | 127 | * WITH TRAILING SLASH! |
| 128 | 128 | */ |
| 129 | -if ( ! defined('PATH_RESOURCES')) { |
|
| 130 | - define('PATH_RESOURCES', PATH_ROOT . DIR_RESOURCES . DIRECTORY_SEPARATOR); |
|
| 129 | +if (!defined('PATH_RESOURCES')) { |
|
| 130 | + define('PATH_RESOURCES', PATH_ROOT.DIR_RESOURCES.DIRECTORY_SEPARATOR); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
@@ -136,14 +136,14 @@ discard block |
||
| 136 | 136 | * FRAMEWORK CONSTANTS |
| 137 | 137 | *--------------------------------------------------------------- |
| 138 | 138 | */ |
| 139 | -require __DIR__ . '/Config/Constants.php'; |
|
| 139 | +require __DIR__.'/Config/Constants.php'; |
|
| 140 | 140 | |
| 141 | 141 | /* |
| 142 | 142 | *--------------------------------------------------------------- |
| 143 | 143 | * FRAMEWORK HELPERS |
| 144 | 144 | *--------------------------------------------------------------- |
| 145 | 145 | */ |
| 146 | -require __DIR__ . '/Helpers/Reactor.php'; |
|
| 146 | +require __DIR__.'/Helpers/Reactor.php'; |
|
| 147 | 147 | |
| 148 | 148 | /** |
| 149 | 149 | * Class Reactor |
@@ -261,12 +261,12 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | if (profiler() !== false) { |
| 264 | - profiler()->watch('Instantiating Requested Commander: ' . $commander->getClass()); |
|
| 264 | + profiler()->watch('Instantiating Requested Commander: '.$commander->getClass()); |
|
| 265 | 265 | } |
| 266 | 266 | $requestCommander = $commander->getInstance(); |
| 267 | 267 | |
| 268 | 268 | if (profiler() !== false) { |
| 269 | - profiler()->watch('Execute Requested Commander: ' . $commander->getClass()); |
|
| 269 | + profiler()->watch('Execute Requested Commander: '.$commander->getClass()); |
|
| 270 | 270 | } |
| 271 | 271 | $requestCommander->execute(); |
| 272 | 272 | |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | if (profiler() !== false) { |
| 318 | - profiler()->watch('Instantiating Requested Controller: ' . $controller->getClass()); |
|
| 318 | + profiler()->watch('Instantiating Requested Controller: '.$controller->getClass()); |
|
| 319 | 319 | } |
| 320 | 320 | $requestController = $controller->getInstance(); |
| 321 | 321 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | public function addNamespace($namespace, $baseDirectory, $prepend = false) |
| 115 | 115 | { |
| 116 | 116 | // normalize namespace prefix |
| 117 | - $namespace = trim($namespace, '\\') . '\\'; |
|
| 117 | + $namespace = trim($namespace, '\\').'\\'; |
|
| 118 | 118 | |
| 119 | 119 | if (empty($namespace) OR $namespace === '\\') { |
| 120 | 120 | return; |
@@ -122,24 +122,24 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | // normalize the base directory with a trailing separator |
| 124 | 124 | $baseDirectory = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $baseDirectory); |
| 125 | - $baseDirectory = rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
| 125 | + $baseDirectory = rtrim($baseDirectory, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
| 126 | 126 | |
| 127 | 127 | if (is_dir($baseDirectory)) { |
| 128 | 128 | // initialize the namespace prefix array |
| 129 | - if (isset($this->namespaceDirs[ $namespace ]) === false) { |
|
| 130 | - $this->namespaceDirs[ $namespace ] = []; |
|
| 129 | + if (isset($this->namespaceDirs[$namespace]) === false) { |
|
| 130 | + $this->namespaceDirs[$namespace] = []; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | // retain the base directory for the namespace prefix |
| 134 | - if ( ! in_array($baseDirectory, $this->namespaceDirs[ $namespace ])) { |
|
| 134 | + if (!in_array($baseDirectory, $this->namespaceDirs[$namespace])) { |
|
| 135 | 135 | if ($prepend) { |
| 136 | - array_unshift($this->namespaceDirs[ $namespace ], $baseDirectory); |
|
| 136 | + array_unshift($this->namespaceDirs[$namespace], $baseDirectory); |
|
| 137 | 137 | } else { |
| 138 | - array_push($this->namespaceDirs[ $namespace ], $baseDirectory); |
|
| 138 | + array_push($this->namespaceDirs[$namespace], $baseDirectory); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - $this->namespaceDirsMap[ $baseDirectory ] = $namespace; |
|
| 142 | + $this->namespaceDirsMap[$baseDirectory] = $namespace; |
|
| 143 | 143 | |
| 144 | 144 | // Register Namespace Language |
| 145 | 145 | language()->addFilePath($baseDirectory); |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | output()->addFilePath($baseDirectory); |
| 149 | 149 | |
| 150 | 150 | // Autoload Composer |
| 151 | - if (is_file($baseDirectory . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php')) { |
|
| 152 | - require($baseDirectory . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); |
|
| 151 | + if (is_file($baseDirectory.'vendor'.DIRECTORY_SEPARATOR.'autoload.php')) { |
|
| 152 | + require($baseDirectory.'vendor'.DIRECTORY_SEPARATOR.'autoload.php'); |
|
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -170,10 +170,10 @@ discard block |
||
| 170 | 170 | $dir = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $dir); |
| 171 | 171 | |
| 172 | 172 | $dir = realpath($dir); |
| 173 | - $dir = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
| 173 | + $dir = rtrim($dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
| 174 | 174 | |
| 175 | 175 | if (array_key_exists($dir, $this->namespaceDirsMap)) { |
| 176 | - return $this->namespaceDirsMap[ $dir ]; |
|
| 176 | + return $this->namespaceDirsMap[$dir]; |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | return false; |
@@ -211,10 +211,10 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | public function getNamespaceDirs($namespace) |
| 213 | 213 | { |
| 214 | - $namespace = trim($namespace, '\\') . '\\'; |
|
| 214 | + $namespace = trim($namespace, '\\').'\\'; |
|
| 215 | 215 | |
| 216 | 216 | if (array_key_exists($namespace, $this->namespaceDirs)) { |
| 217 | - return $this->namespaceDirs[ $namespace ]; |
|
| 217 | + return $this->namespaceDirs[$namespace]; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | return false; |
@@ -237,33 +237,33 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | if ($this->requireFile($helper)) { |
| 240 | - $this->loadedHelpers[ pathinfo($helper, PATHINFO_FILENAME) ][] = $helper; |
|
| 240 | + $this->loadedHelpers[pathinfo($helper, PATHINFO_FILENAME)][] = $helper; |
|
| 241 | 241 | |
| 242 | 242 | return; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | $helperDirectories = [ |
| 246 | - PATH_KERNEL . 'Helpers' . DIRECTORY_SEPARATOR, |
|
| 247 | - PATH_FRAMEWORK . 'Helpers' . DIRECTORY_SEPARATOR, |
|
| 248 | - PATH_APP . 'Helpers' . DIRECTORY_SEPARATOR, |
|
| 246 | + PATH_KERNEL.'Helpers'.DIRECTORY_SEPARATOR, |
|
| 247 | + PATH_FRAMEWORK.'Helpers'.DIRECTORY_SEPARATOR, |
|
| 248 | + PATH_APP.'Helpers'.DIRECTORY_SEPARATOR, |
|
| 249 | 249 | ]; |
| 250 | 250 | |
| 251 | 251 | if (method_exists(modules(), 'current')) { |
| 252 | - array_push($helperDirectories, modules()->current()->getPath() . 'Helpers' . DIRECTORY_SEPARATOR); |
|
| 252 | + array_push($helperDirectories, modules()->current()->getPath().'Helpers'.DIRECTORY_SEPARATOR); |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | - if ( ! array_key_exists($helper, $this->loadedHelpers)) { |
|
| 256 | - $this->loadedHelpers[ $helper ] = []; |
|
| 255 | + if (!array_key_exists($helper, $this->loadedHelpers)) { |
|
| 256 | + $this->loadedHelpers[$helper] = []; |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | foreach ($helperDirectories as $helperDirectory) { |
| 260 | 260 | |
| 261 | - $helperFilePath = $helperDirectory . studlycase($helper) . '.php'; |
|
| 261 | + $helperFilePath = $helperDirectory.studlycase($helper).'.php'; |
|
| 262 | 262 | |
| 263 | - if (in_array($helperFilePath, $this->loadedHelpers[ $helper ])) { |
|
| 263 | + if (in_array($helperFilePath, $this->loadedHelpers[$helper])) { |
|
| 264 | 264 | continue; |
| 265 | 265 | } elseif ($this->requireFile($helperFilePath)) { |
| 266 | - $this->loadedHelpers[ $helper ][] = $helperFilePath; |
|
| 266 | + $this->loadedHelpers[$helper][] = $helperFilePath; |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | } |
@@ -339,12 +339,12 @@ discard block |
||
| 339 | 339 | public function loadMappedFile($namespace, $relativeClass) |
| 340 | 340 | { |
| 341 | 341 | // are there any base directories for this namespace prefix? |
| 342 | - if (isset($this->namespaceDirs[ $namespace ]) === false) { |
|
| 342 | + if (isset($this->namespaceDirs[$namespace]) === false) { |
|
| 343 | 343 | return false; |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | // look through base directories for this namespace prefix |
| 347 | - foreach ($this->namespaceDirs[ $namespace ] as $namespaceDirectory) { |
|
| 347 | + foreach ($this->namespaceDirs[$namespace] as $namespaceDirectory) { |
|
| 348 | 348 | |
| 349 | 349 | // replace the namespace prefix with the base directory, |
| 350 | 350 | // replace namespace separators with directory separators |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | public function __construct() |
| 32 | 32 | { |
| 33 | 33 | if (is_file( |
| 34 | - $filePath = PATH_APP . 'Config' . DIRECTORY_SEPARATOR . ucfirst( |
|
| 34 | + $filePath = PATH_APP.'Config'.DIRECTORY_SEPARATOR.ucfirst( |
|
| 35 | 35 | strtolower(ENVIRONMENT) |
| 36 | - ) . DIRECTORY_SEPARATOR . 'Config.php' |
|
| 36 | + ).DIRECTORY_SEPARATOR.'Config.php' |
|
| 37 | 37 | )) { |
| 38 | 38 | include($filePath); |
| 39 | - } elseif (is_file($filePath = PATH_APP . 'Config' . DIRECTORY_SEPARATOR . 'Config.php')) { |
|
| 39 | + } elseif (is_file($filePath = PATH_APP.'Config'.DIRECTORY_SEPARATOR.'Config.php')) { |
|
| 40 | 40 | include($filePath); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -71,18 +71,18 @@ discard block |
||
| 71 | 71 | $offset = camelcase($basename); |
| 72 | 72 | |
| 73 | 73 | $configDirs = [ |
| 74 | - PATH_REACTOR . 'Config' . DIRECTORY_SEPARATOR, |
|
| 75 | - PATH_APP . 'Config' . DIRECTORY_SEPARATOR, |
|
| 74 | + PATH_REACTOR.'Config'.DIRECTORY_SEPARATOR, |
|
| 75 | + PATH_APP.'Config'.DIRECTORY_SEPARATOR, |
|
| 76 | 76 | ]; |
| 77 | 77 | |
| 78 | 78 | foreach ($configDirs as $configDir) { |
| 79 | 79 | if (is_file( |
| 80 | - $filePath = $configDir . ucfirst( |
|
| 80 | + $filePath = $configDir.ucfirst( |
|
| 81 | 81 | strtolower(ENVIRONMENT) |
| 82 | - ) . DIRECTORY_SEPARATOR . $configFile . '.php' |
|
| 82 | + ).DIRECTORY_SEPARATOR.$configFile.'.php' |
|
| 83 | 83 | )) { |
| 84 | 84 | include($filePath); |
| 85 | - } elseif (is_file($filePath = $configDir . DIRECTORY_SEPARATOR . $configFile . '.php')) { |
|
| 85 | + } elseif (is_file($filePath = $configDir.DIRECTORY_SEPARATOR.$configFile.'.php')) { |
|
| 86 | 86 | include($filePath); |
| 87 | 87 | } |
| 88 | 88 | } |