@@ -41,7 +41,7 @@ discard block |
||
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'); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | if (isset($service) && $service instanceof SplServiceRegistry) { |
76 | 76 | if (profiler() !== false) { |
77 | - profiler()->watch('Load New Model: ' . $service->getClassName()); |
|
77 | + profiler()->watch('Load New Model: '.$service->getClassName()); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | $this->register($service, $offset); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $this->attach($offset, $service); |
104 | 104 | |
105 | 105 | if (profiler() !== false) { |
106 | - profiler()->watch('Register New Model: ' . $service->getClassName()); |
|
106 | + profiler()->watch('Register New Model: '.$service->getClassName()); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | } |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | public function add($model, $offset = null) |
121 | 121 | { |
122 | 122 | if (is_object($model)) { |
123 | - if ( ! $model instanceof SplServiceRegistry) { |
|
123 | + if (!$model instanceof SplServiceRegistry) { |
|
124 | 124 | $model = new SplServiceRegistry($model); |
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
128 | 128 | if (profiler() !== false) { |
129 | - profiler()->watch('Add New Model: ' . $model->getClassName()); |
|
129 | + profiler()->watch('Add New Model: '.$model->getClassName()); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | $this->register($model, $offset); |
@@ -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 | } |
@@ -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 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | */ |
307 | 307 | public function count() |
308 | 308 | { |
309 | - return (int)count($GLOBALS); |
|
309 | + return (int) count($GLOBALS); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | // ------------------------------------------------------------------------ |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | */ |
415 | 415 | public function has($id) |
416 | 416 | { |
417 | - return (bool)$this->offsetExists($id); |
|
417 | + return (bool) $this->offsetExists($id); |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | // ------------------------------------------------------------------------ |
@@ -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 |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function offsetExists($offset) |
105 | 105 | { |
106 | - return isset($_ENV[ $offset ]); |
|
106 | + return isset($_ENV[$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 $_ENV[ $offset ]; |
|
123 | + return $_ENV[$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 | - $_ENV[ $offset ] = $value; |
|
181 | + $_ENV[$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($_ENV[ $offset ])) { |
|
237 | - unset($_ENV[ $offset ]); |
|
236 | + if (isset($_ENV[$offset])) { |
|
237 | + unset($_ENV[$offset]); |
|
238 | 238 | } |
239 | 239 | } |
240 | 240 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | */ |
307 | 307 | public function count() |
308 | 308 | { |
309 | - return (int)count($_ENV); |
|
309 | + return (int) count($_ENV); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | // ------------------------------------------------------------------------ |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | */ |
415 | 415 | public function has($id) |
416 | 416 | { |
417 | - return (bool)$this->offsetExists($id); |
|
417 | + return (bool) $this->offsetExists($id); |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | // ------------------------------------------------------------------------ |
@@ -435,6 +435,6 @@ discard block |
||
435 | 435 | */ |
436 | 436 | public function offsetGet($offset) |
437 | 437 | { |
438 | - return (isset($_ENV[ $offset ])) ? $_ENV[ $offset ] : false; |
|
438 | + return (isset($_ENV[$offset])) ? $_ENV[$offset] : false; |
|
439 | 439 | } |
440 | 440 | } |
441 | 441 | \ No newline at end of file |
@@ -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 | * |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | function loader() |
38 | 38 | { |
39 | - if(services()->has('loader')) { |
|
39 | + if (services()->has('loader')) { |
|
40 | 40 | return services()->get('loader'); |
41 | 41 | } |
42 | 42 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | // ------------------------------------------------------------------------ |
48 | 48 | |
49 | -if ( ! function_exists('config')) { |
|
49 | +if (!function_exists('config')) { |
|
50 | 50 | /** |
51 | 51 | * config |
52 | 52 | * |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | if ($numArgs = count($args)) { |
62 | 62 | $config = o2system()->config; |
63 | 63 | |
64 | - if($numArgs == 1) { |
|
64 | + if ($numArgs == 1) { |
|
65 | 65 | return call_user_func_array([&$config, 'getItem'], $args); |
66 | 66 | } else { |
67 | 67 | return call_user_func_array([&$config, 'loadFile'], $args); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | // ------------------------------------------------------------------------ |
76 | 76 | |
77 | -if ( ! function_exists('globals')) { |
|
77 | +if (!function_exists('globals')) { |
|
78 | 78 | /** |
79 | 79 | * globals |
80 | 80 | * |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | $args = func_get_args(); |
88 | 88 | |
89 | 89 | if (count($args)) { |
90 | - if (isset($GLOBALS[ $args[ 0 ] ])) { |
|
91 | - return $GLOBALS[ $args[ 0 ] ]; |
|
90 | + if (isset($GLOBALS[$args[0]])) { |
|
91 | + return $GLOBALS[$args[0]]; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | return null; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | // ------------------------------------------------------------------------ |
102 | 102 | |
103 | -if ( ! function_exists('env')) { |
|
103 | +if (!function_exists('env')) { |
|
104 | 104 | /** |
105 | 105 | * env |
106 | 106 | * |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | $args = func_get_args(); |
114 | 114 | |
115 | 115 | if (count($args)) { |
116 | - if (isset($_ENV[ $args[ 0 ] ])) { |
|
117 | - return $_ENV[ $args[ 0 ] ]; |
|
116 | + if (isset($_ENV[$args[0]])) { |
|
117 | + return $_ENV[$args[0]]; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | return null; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | // ------------------------------------------------------------------------ |
128 | 128 | |
129 | -if ( ! function_exists('cache')) { |
|
129 | +if (!function_exists('cache')) { |
|
130 | 130 | /** |
131 | 131 | * cache |
132 | 132 | * |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | function cache() |
138 | 138 | { |
139 | - if(services()->has('cache')) { |
|
139 | + if (services()->has('cache')) { |
|
140 | 140 | return services()->get('cache'); |
141 | 141 | } |
142 | 142 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | // ------------------------------------------------------------------------ |
148 | 148 | |
149 | -if ( ! function_exists('database')) { |
|
149 | +if (!function_exists('database')) { |
|
150 | 150 | /** |
151 | 151 | * database |
152 | 152 | * |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | // ------------------------------------------------------------------------ |
164 | 164 | |
165 | -if ( ! function_exists('models')) { |
|
165 | +if (!function_exists('models')) { |
|
166 | 166 | /** |
167 | 167 | * models |
168 | 168 | * |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $args = func_get_args(); |
176 | 176 | |
177 | 177 | if (count($args)) { |
178 | - return o2system()->models->get($args[ 0 ]); |
|
178 | + return o2system()->models->get($args[0]); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | return o2system()->models; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | // ------------------------------------------------------------------------ |
186 | 186 | |
187 | -if ( ! function_exists('router')) { |
|
187 | +if (!function_exists('router')) { |
|
188 | 188 | /** |
189 | 189 | * router |
190 | 190 | * |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | */ |
195 | 195 | function router() |
196 | 196 | { |
197 | - if(services()->has('router')) { |
|
197 | + if (services()->has('router')) { |
|
198 | 198 | return services()->get('router'); |
199 | 199 | } |
200 | 200 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | // ------------------------------------------------------------------------ |
206 | 206 | |
207 | -if ( ! function_exists('session')) { |
|
207 | +if (!function_exists('session')) { |
|
208 | 208 | /** |
209 | 209 | * session |
210 | 210 | * |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | $args = func_get_args(); |
218 | 218 | |
219 | 219 | if (count($args)) { |
220 | - if(isset($_SESSION[ $args[0] ])) { |
|
221 | - return $_SESSION[ $args[0] ]; |
|
220 | + if (isset($_SESSION[$args[0]])) { |
|
221 | + return $_SESSION[$args[0]]; |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | return null; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | // ------------------------------------------------------------------------ |
232 | 232 | |
233 | -if ( ! function_exists('middleware')) { |
|
233 | +if (!function_exists('middleware')) { |
|
234 | 234 | /** |
235 | 235 | * O2System |
236 | 236 | * |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | function middleware() |
242 | 242 | { |
243 | - if(services()->has('middleware')) { |
|
243 | + if (services()->has('middleware')) { |
|
244 | 244 | return services()->get('middleware'); |
245 | 245 | } |
246 | 246 | |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | // ------------------------------------------------------------------------ |
252 | 252 | |
253 | -if ( ! function_exists('controller')) { |
|
253 | +if (!function_exists('controller')) { |
|
254 | 254 | /** |
255 | 255 | * controller |
256 | 256 | * |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | */ |
261 | 261 | function controller() |
262 | 262 | { |
263 | - if(services()->has('controller')) { |
|
263 | + if (services()->has('controller')) { |
|
264 | 264 | $args = func_get_args(); |
265 | 265 | |
266 | 266 | if (count($args)) { |
@@ -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_DATABASE')) { |
|
130 | - define('PATH_DATABASE', PATH_ROOT . DIR_DATABASE . DIRECTORY_SEPARATOR); |
|
129 | +if (!defined('PATH_DATABASE')) { |
|
130 | + define('PATH_DATABASE', PATH_ROOT.DIR_DATABASE.DIRECTORY_SEPARATOR); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /* |
@@ -135,14 +135,14 @@ discard block |
||
135 | 135 | * FRAMEWORK CONSTANTS |
136 | 136 | *--------------------------------------------------------------- |
137 | 137 | */ |
138 | -require __DIR__ . '/Config/Constants.php'; |
|
138 | +require __DIR__.'/Config/Constants.php'; |
|
139 | 139 | |
140 | 140 | /* |
141 | 141 | *--------------------------------------------------------------- |
142 | 142 | * FRAMEWORK HELPERS |
143 | 143 | *--------------------------------------------------------------- |
144 | 144 | */ |
145 | -require __DIR__ . '/Helpers/Reactor.php'; |
|
145 | +require __DIR__.'/Helpers/Reactor.php'; |
|
146 | 146 | |
147 | 147 | /** |
148 | 148 | * Class Reactor |
@@ -298,12 +298,12 @@ discard block |
||
298 | 298 | } |
299 | 299 | |
300 | 300 | if (profiler() !== false) { |
301 | - profiler()->watch('Instantiating Requested Commander: ' . $commander->getClass()); |
|
301 | + profiler()->watch('Instantiating Requested Commander: '.$commander->getClass()); |
|
302 | 302 | } |
303 | 303 | $requestCommander = $commander->getInstance(); |
304 | 304 | |
305 | 305 | if (profiler() !== false) { |
306 | - profiler()->watch('Execute Requested Commander: ' . $commander->getClass()); |
|
306 | + profiler()->watch('Execute Requested Commander: '.$commander->getClass()); |
|
307 | 307 | } |
308 | 308 | $requestCommander->execute(); |
309 | 309 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | middleware()->run(); |
339 | 339 | |
340 | - if($this->services->has('controller')) { |
|
340 | + if ($this->services->has('controller')) { |
|
341 | 341 | $controller = $this->services->get('controller'); |
342 | 342 | |
343 | 343 | // Autoload Model |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | } |
349 | 349 | |
350 | 350 | if (profiler() !== false) { |
351 | - profiler()->watch('Instantiating Requested Controller: ' . $controller->getClass()); |
|
351 | + profiler()->watch('Instantiating Requested Controller: '.$controller->getClass()); |
|
352 | 352 | } |
353 | 353 | $requestController = $controller->getInstance(); |
354 | 354 |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public function addNamespace($namespace, $baseDirectory, $prepend = false) |
104 | 104 | { |
105 | 105 | // normalize namespace prefix |
106 | - $namespace = trim($namespace, '\\') . '\\'; |
|
106 | + $namespace = trim($namespace, '\\').'\\'; |
|
107 | 107 | |
108 | 108 | if (empty($namespace) OR $namespace === '\\') { |
109 | 109 | return; |
@@ -111,24 +111,24 @@ discard block |
||
111 | 111 | |
112 | 112 | // normalize the base directory with a trailing separator |
113 | 113 | $baseDirectory = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $baseDirectory); |
114 | - $baseDirectory = rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
114 | + $baseDirectory = rtrim($baseDirectory, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
115 | 115 | |
116 | 116 | if (is_dir($baseDirectory)) { |
117 | 117 | // initialize the namespace prefix array |
118 | - if (isset($this->namespaceDirs[ $namespace ]) === false) { |
|
119 | - $this->namespaceDirs[ $namespace ] = []; |
|
118 | + if (isset($this->namespaceDirs[$namespace]) === false) { |
|
119 | + $this->namespaceDirs[$namespace] = []; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | // retain the base directory for the namespace prefix |
123 | - if ( ! in_array($baseDirectory, $this->namespaceDirs[ $namespace ])) { |
|
123 | + if (!in_array($baseDirectory, $this->namespaceDirs[$namespace])) { |
|
124 | 124 | if ($prepend) { |
125 | - array_unshift($this->namespaceDirs[ $namespace ], $baseDirectory); |
|
125 | + array_unshift($this->namespaceDirs[$namespace], $baseDirectory); |
|
126 | 126 | } else { |
127 | - array_push($this->namespaceDirs[ $namespace ], $baseDirectory); |
|
127 | + array_push($this->namespaceDirs[$namespace], $baseDirectory); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | - $this->namespaceDirsMap[ $baseDirectory ] = $namespace; |
|
131 | + $this->namespaceDirsMap[$baseDirectory] = $namespace; |
|
132 | 132 | |
133 | 133 | // Register Namespace Language |
134 | 134 | language()->addFilePath($baseDirectory); |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | output()->addFilePath($baseDirectory); |
138 | 138 | |
139 | 139 | // Autoload Composer |
140 | - if (is_file($baseDirectory . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php')) { |
|
141 | - require($baseDirectory . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); |
|
140 | + if (is_file($baseDirectory.'vendor'.DIRECTORY_SEPARATOR.'autoload.php')) { |
|
141 | + require($baseDirectory.'vendor'.DIRECTORY_SEPARATOR.'autoload.php'); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | } |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | $dir = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $dir); |
160 | 160 | |
161 | 161 | $dir = realpath($dir); |
162 | - $dir = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
162 | + $dir = rtrim($dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
163 | 163 | |
164 | 164 | if (array_key_exists($dir, $this->namespaceDirsMap)) { |
165 | - return $this->namespaceDirsMap[ $dir ]; |
|
165 | + return $this->namespaceDirsMap[$dir]; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | return false; |
@@ -200,10 +200,10 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function getNamespaceDirs($namespace) |
202 | 202 | { |
203 | - $namespace = trim($namespace, '\\') . '\\'; |
|
203 | + $namespace = trim($namespace, '\\').'\\'; |
|
204 | 204 | |
205 | 205 | if (array_key_exists($namespace, $this->namespaceDirs)) { |
206 | - return $this->namespaceDirs[ $namespace ]; |
|
206 | + return $this->namespaceDirs[$namespace]; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | return false; |
@@ -226,29 +226,29 @@ discard block |
||
226 | 226 | } |
227 | 227 | |
228 | 228 | if ($this->requireFile($helper)) { |
229 | - $this->loadedHelpers[ pathinfo($helper, PATHINFO_FILENAME) ][] = $helper; |
|
229 | + $this->loadedHelpers[pathinfo($helper, PATHINFO_FILENAME)][] = $helper; |
|
230 | 230 | |
231 | 231 | return; |
232 | 232 | } |
233 | 233 | |
234 | 234 | $helperDirectories = [ |
235 | - PATH_KERNEL . 'Helpers' . DIRECTORY_SEPARATOR, |
|
236 | - PATH_REACTOR . 'Helpers' . DIRECTORY_SEPARATOR, |
|
237 | - PATH_APP . 'Helpers' . DIRECTORY_SEPARATOR, |
|
235 | + PATH_KERNEL.'Helpers'.DIRECTORY_SEPARATOR, |
|
236 | + PATH_REACTOR.'Helpers'.DIRECTORY_SEPARATOR, |
|
237 | + PATH_APP.'Helpers'.DIRECTORY_SEPARATOR, |
|
238 | 238 | ]; |
239 | 239 | |
240 | - if ( ! array_key_exists($helper, $this->loadedHelpers)) { |
|
241 | - $this->loadedHelpers[ $helper ] = []; |
|
240 | + if (!array_key_exists($helper, $this->loadedHelpers)) { |
|
241 | + $this->loadedHelpers[$helper] = []; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | foreach ($helperDirectories as $helperDirectory) { |
245 | 245 | |
246 | - $helperFilePath = $helperDirectory . studlycase($helper) . '.php'; |
|
246 | + $helperFilePath = $helperDirectory.studlycase($helper).'.php'; |
|
247 | 247 | |
248 | - if (in_array($helperFilePath, $this->loadedHelpers[ $helper ])) { |
|
248 | + if (in_array($helperFilePath, $this->loadedHelpers[$helper])) { |
|
249 | 249 | continue; |
250 | 250 | } elseif ($this->requireFile($helperFilePath)) { |
251 | - $this->loadedHelpers[ $helper ][] = $helperFilePath; |
|
251 | + $this->loadedHelpers[$helper][] = $helperFilePath; |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | } |
@@ -324,12 +324,12 @@ discard block |
||
324 | 324 | public function loadMappedFile($namespace, $relativeClass) |
325 | 325 | { |
326 | 326 | // are there any base directories for this namespace prefix? |
327 | - if (isset($this->namespaceDirs[ $namespace ]) === false) { |
|
327 | + if (isset($this->namespaceDirs[$namespace]) === false) { |
|
328 | 328 | return false; |
329 | 329 | } |
330 | 330 | |
331 | 331 | // look through base directories for this namespace prefix |
332 | - foreach ($this->namespaceDirs[ $namespace ] as $namespaceDirectory) { |
|
332 | + foreach ($this->namespaceDirs[$namespace] as $namespaceDirectory) { |
|
333 | 333 | |
334 | 334 | // replace the namespace prefix with the base directory, |
335 | 335 | // replace namespace separators with directory separators |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | public function optionPath($path) |
98 | 98 | { |
99 | 99 | $path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path); |
100 | - $path = PATH_ROOT . str_replace(PATH_ROOT, '', $path); |
|
100 | + $path = PATH_ROOT.str_replace(PATH_ROOT, '', $path); |
|
101 | 101 | |
102 | 102 | if (pathinfo($path, PATHINFO_EXTENSION)) { |
103 | 103 | $this->optionFilename(pathinfo($path, PATHINFO_FILENAME)); |
104 | 104 | $path = dirname($path); |
105 | 105 | } |
106 | 106 | |
107 | - $this->optionPath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
107 | + $this->optionPath = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | // ------------------------------------------------------------------------ |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | public function optionFilename($name) |
118 | 118 | { |
119 | 119 | $name = str_replace('.php', '', $name); |
120 | - $this->optionFilename = prepare_filename($name) . '.php'; |
|
120 | + $this->optionFilename = prepare_filename($name).'.php'; |
|
121 | 121 | |
122 | 122 | $this->optionPath = empty($this->optionPath) ? modules()->current()->getRealPath() : $this->optionPath; |
123 | 123 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | public function getPhpTemplateFile($filename) |
157 | 157 | { |
158 | 158 | $directories = [ |
159 | - PATH_REACTOR . 'Config' . DIRECTORY_SEPARATOR . 'PhpTemplateFiles', |
|
159 | + PATH_REACTOR.'Config'.DIRECTORY_SEPARATOR.'PhpTemplateFiles', |
|
160 | 160 | ]; |
161 | 161 | |
162 | 162 | } |