@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | $offset = camelcase($basename); |
| 43 | 43 | |
| 44 | 44 | $configDirs = [ |
| 45 | - PATH_FRAMEWORK . 'Config' . DIRECTORY_SEPARATOR, |
|
| 46 | - PATH_APP . 'Config' . DIRECTORY_SEPARATOR, |
|
| 45 | + PATH_FRAMEWORK.'Config'.DIRECTORY_SEPARATOR, |
|
| 46 | + PATH_APP.'Config'.DIRECTORY_SEPARATOR, |
|
| 47 | 47 | ]; |
| 48 | 48 | |
| 49 | 49 | if (method_exists(modules(), 'getDirs')) { |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | foreach ($configDirs as $configDir) { |
| 54 | 54 | if (is_file( |
| 55 | - $filePath = $configDir . ucfirst( |
|
| 55 | + $filePath = $configDir.ucfirst( |
|
| 56 | 56 | strtolower(ENVIRONMENT) |
| 57 | - ) . DIRECTORY_SEPARATOR . $configFile . '.php' |
|
| 57 | + ).DIRECTORY_SEPARATOR.$configFile.'.php' |
|
| 58 | 58 | )) { |
| 59 | 59 | include($filePath); |
| 60 | - } elseif (is_file($filePath = $configDir . DIRECTORY_SEPARATOR . $configFile . '.php')) { |
|
| 60 | + } elseif (is_file($filePath = $configDir.DIRECTORY_SEPARATOR.$configFile.'.php')) { |
|
| 61 | 61 | include($filePath); |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | public function addNamespace($namespace, $baseDirectory, $prepend = false) |
| 118 | 118 | { |
| 119 | 119 | // normalize namespace prefix |
| 120 | - $namespace = trim($namespace, '\\') . '\\'; |
|
| 120 | + $namespace = trim($namespace, '\\').'\\'; |
|
| 121 | 121 | |
| 122 | 122 | if (empty($namespace) OR $namespace === '\\') { |
| 123 | 123 | return; |
@@ -125,24 +125,24 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | // normalize the base directory with a trailing separator |
| 127 | 127 | $baseDirectory = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $baseDirectory); |
| 128 | - $baseDirectory = rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
| 128 | + $baseDirectory = rtrim($baseDirectory, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
| 129 | 129 | |
| 130 | 130 | if (is_dir($baseDirectory)) { |
| 131 | 131 | // initialize the namespace prefix array |
| 132 | - if (isset($this->namespaceDirs[ $namespace ]) === false) { |
|
| 133 | - $this->namespaceDirs[ $namespace ] = []; |
|
| 132 | + if (isset($this->namespaceDirs[$namespace]) === false) { |
|
| 133 | + $this->namespaceDirs[$namespace] = []; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | // retain the base directory for the namespace prefix |
| 137 | - if ( ! in_array($baseDirectory, $this->namespaceDirs[ $namespace ])) { |
|
| 137 | + if (!in_array($baseDirectory, $this->namespaceDirs[$namespace])) { |
|
| 138 | 138 | if ($prepend) { |
| 139 | - array_unshift($this->namespaceDirs[ $namespace ], $baseDirectory); |
|
| 139 | + array_unshift($this->namespaceDirs[$namespace], $baseDirectory); |
|
| 140 | 140 | } else { |
| 141 | - array_push($this->namespaceDirs[ $namespace ], $baseDirectory); |
|
| 141 | + array_push($this->namespaceDirs[$namespace], $baseDirectory); |
|
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $this->namespaceDirsMap[ $baseDirectory ] = $namespace; |
|
| 145 | + $this->namespaceDirsMap[$baseDirectory] = $namespace; |
|
| 146 | 146 | |
| 147 | 147 | // Register Namespace Language |
| 148 | 148 | language()->addFilePath($baseDirectory); |
@@ -156,8 +156,8 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | // Autoload Composer |
| 159 | - if (is_file($baseDirectory . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php')) { |
|
| 160 | - require($baseDirectory . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); |
|
| 159 | + if (is_file($baseDirectory.'vendor'.DIRECTORY_SEPARATOR.'autoload.php')) { |
|
| 160 | + require($baseDirectory.'vendor'.DIRECTORY_SEPARATOR.'autoload.php'); |
|
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | } |
@@ -175,12 +175,12 @@ discard block |
||
| 175 | 175 | { |
| 176 | 176 | // normalize the public directory with a trailing separator |
| 177 | 177 | $publicDir = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $publicDir); |
| 178 | - $publicDir = PATH_PUBLIC . str_replace(PATH_PUBLIC, '', $publicDir); |
|
| 179 | - $publicDir = rtrim($publicDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
| 178 | + $publicDir = PATH_PUBLIC.str_replace(PATH_PUBLIC, '', $publicDir); |
|
| 179 | + $publicDir = rtrim($publicDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
| 180 | 180 | |
| 181 | - if (is_dir($publicDir) and ! in_array($publicDir, $this->publicDirs)) { |
|
| 181 | + if (is_dir($publicDir) and !in_array($publicDir, $this->publicDirs)) { |
|
| 182 | 182 | if (isset($offset)) { |
| 183 | - $this->publicDirs[ $offset ] = $publicDir; |
|
| 183 | + $this->publicDirs[$offset] = $publicDir; |
|
| 184 | 184 | } else { |
| 185 | 185 | $this->publicDirs[] = $publicDir; |
| 186 | 186 | } |
@@ -219,10 +219,10 @@ discard block |
||
| 219 | 219 | $dir = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $dir); |
| 220 | 220 | |
| 221 | 221 | $dir = realpath($dir); |
| 222 | - $dir = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
| 222 | + $dir = rtrim($dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
| 223 | 223 | |
| 224 | 224 | if (array_key_exists($dir, $this->namespaceDirsMap)) { |
| 225 | - return $this->namespaceDirsMap[ $dir ]; |
|
| 225 | + return $this->namespaceDirsMap[$dir]; |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | return false; |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | public function getNamespaceDirs($namespace) |
| 262 | 262 | { |
| 263 | - $namespace = trim($namespace, '\\') . '\\'; |
|
| 263 | + $namespace = trim($namespace, '\\').'\\'; |
|
| 264 | 264 | |
| 265 | 265 | if (array_key_exists($namespace, $this->namespaceDirs)) { |
| 266 | - return $this->namespaceDirs[ $namespace ]; |
|
| 266 | + return $this->namespaceDirs[$namespace]; |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | return false; |
@@ -286,33 +286,33 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | if ($this->requireFile($helper)) { |
| 289 | - $this->loadedHelpers[ pathinfo($helper, PATHINFO_FILENAME) ][] = $helper; |
|
| 289 | + $this->loadedHelpers[pathinfo($helper, PATHINFO_FILENAME)][] = $helper; |
|
| 290 | 290 | |
| 291 | 291 | return; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | $helperDirectories = [ |
| 295 | - PATH_KERNEL . 'Helpers' . DIRECTORY_SEPARATOR, |
|
| 296 | - PATH_FRAMEWORK . 'Helpers' . DIRECTORY_SEPARATOR, |
|
| 297 | - PATH_APP . 'Helpers' . DIRECTORY_SEPARATOR, |
|
| 295 | + PATH_KERNEL.'Helpers'.DIRECTORY_SEPARATOR, |
|
| 296 | + PATH_FRAMEWORK.'Helpers'.DIRECTORY_SEPARATOR, |
|
| 297 | + PATH_APP.'Helpers'.DIRECTORY_SEPARATOR, |
|
| 298 | 298 | ]; |
| 299 | 299 | |
| 300 | 300 | if (method_exists(modules(), 'current')) { |
| 301 | - array_push($helperDirectories, modules()->current()->getPath() . 'Helpers' . DIRECTORY_SEPARATOR); |
|
| 301 | + array_push($helperDirectories, modules()->current()->getPath().'Helpers'.DIRECTORY_SEPARATOR); |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | - if ( ! array_key_exists($helper, $this->loadedHelpers)) { |
|
| 305 | - $this->loadedHelpers[ $helper ] = []; |
|
| 304 | + if (!array_key_exists($helper, $this->loadedHelpers)) { |
|
| 305 | + $this->loadedHelpers[$helper] = []; |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | foreach ($helperDirectories as $helperDirectory) { |
| 309 | 309 | |
| 310 | - $helperFilePath = $helperDirectory . studlycase($helper) . '.php'; |
|
| 310 | + $helperFilePath = $helperDirectory.studlycase($helper).'.php'; |
|
| 311 | 311 | |
| 312 | - if (in_array($helperFilePath, $this->loadedHelpers[ $helper ])) { |
|
| 312 | + if (in_array($helperFilePath, $this->loadedHelpers[$helper])) { |
|
| 313 | 313 | continue; |
| 314 | 314 | } elseif ($this->requireFile($helperFilePath)) { |
| 315 | - $this->loadedHelpers[ $helper ][] = $helperFilePath; |
|
| 315 | + $this->loadedHelpers[$helper][] = $helperFilePath; |
|
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | } |
@@ -345,20 +345,20 @@ discard block |
||
| 345 | 345 | $namespaceParts = explode('\\', get_namespace($class)); |
| 346 | 346 | $namespaceParts = array_filter($namespaceParts); |
| 347 | 347 | |
| 348 | - $namespace = reset($namespaceParts) . '\\'; |
|
| 348 | + $namespace = reset($namespaceParts).'\\'; |
|
| 349 | 349 | |
| 350 | 350 | if (empty($namespaceModules) && modules() !== false) { |
| 351 | 351 | if (false !== ($modules = modules()->getRegistry())) { |
| 352 | 352 | foreach ($modules as $module) { |
| 353 | 353 | if ($module instanceof Module) { |
| 354 | - $namespaceModules[ $module->getNamespace() ] = $module; |
|
| 354 | + $namespaceModules[$module->getNamespace()] = $module; |
|
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | - if (isset($namespaceModules[ $namespace ])) { |
|
| 361 | - $module = $namespaceModules[ $namespace ]; |
|
| 360 | + if (isset($namespaceModules[$namespace])) { |
|
| 361 | + $module = $namespaceModules[$namespace]; |
|
| 362 | 362 | $this->addNamespace($module->getNamespace(), $module->getRealPath()); |
| 363 | 363 | } |
| 364 | 364 | |
@@ -416,12 +416,12 @@ discard block |
||
| 416 | 416 | public function loadMappedFile($namespace, $relativeClass) |
| 417 | 417 | { |
| 418 | 418 | // are there any base directories for this namespace prefix? |
| 419 | - if (isset($this->namespaceDirs[ $namespace ]) === false) { |
|
| 419 | + if (isset($this->namespaceDirs[$namespace]) === false) { |
|
| 420 | 420 | return false; |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | // look through base directories for this namespace prefix |
| 424 | - foreach ($this->namespaceDirs[ $namespace ] as $namespaceDirectory) { |
|
| 424 | + foreach ($this->namespaceDirs[$namespace] as $namespaceDirectory) { |
|
| 425 | 425 | |
| 426 | 426 | // replace the namespace prefix with the base directory, |
| 427 | 427 | // replace namespace separators with directory separators |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | $poolOffset = $this->poolOffset; |
| 79 | 79 | |
| 80 | - if ( ! $this->exists($poolOffset)) { |
|
| 80 | + if (!$this->exists($poolOffset)) { |
|
| 81 | 81 | $poolOffset = 'default'; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function delete($key) |
| 156 | 156 | { |
| 157 | - return (bool)$this->deleteItem($key); |
|
| 157 | + return (bool) $this->deleteItem($key); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | // ------------------------------------------------------------------------ |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | foreach ($keys as $key) { |
| 202 | 202 | if ($this->exists($key)) { |
| 203 | - $result[ $key ] = $this->get($key, $default); |
|
| 203 | + $result[$key] = $this->get($key, $default); |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
@@ -308,11 +308,11 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | foreach ($values as $key => $value) { |
| 310 | 310 | if ($this->set($key, $value, $ttl)) { |
| 311 | - $result[ $key ] = true; |
|
| 311 | + $result[$key] = true; |
|
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - return (bool)count($result) == count($values); |
|
| 315 | + return (bool) count($result) == count($values); |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | // ------------------------------------------------------------------------ |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | */ |
| 370 | 370 | public function deleteMultiple($keys) |
| 371 | 371 | { |
| 372 | - return (bool)$this->deleteItems($keys); |
|
| 372 | + return (bool) $this->deleteItems($keys); |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | // ------------------------------------------------------------------------ |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | public function __construct() |
| 27 | 27 | { |
| 28 | 28 | $config = config()->get('logger'); |
| 29 | - $config[ 'path' ] = PATH_CACHE . 'log' . DIRECTORY_SEPARATOR; |
|
| 29 | + $config['path'] = PATH_CACHE.'log'.DIRECTORY_SEPARATOR; |
|
| 30 | 30 | |
| 31 | 31 | parent::__construct(new Config($config)); |
| 32 | 32 | } |
@@ -38,12 +38,12 @@ |
||
| 38 | 38 | $debugIpAddresses = config('ipAddresses')->offsetGet('debug'); |
| 39 | 39 | |
| 40 | 40 | if (in_array($clientIpAddress, $debugIpAddresses)) { |
| 41 | - $_ENV[ 'DEBUG_STAGE' ] = 'DEVELOPER'; |
|
| 41 | + $_ENV['DEBUG_STAGE'] = 'DEVELOPER'; |
|
| 42 | 42 | |
| 43 | 43 | error_reporting(-1); |
| 44 | 44 | ini_set('display_errors', 1); |
| 45 | 45 | |
| 46 | - if (isset($_REQUEST[ 'PHP_INFO' ])) { |
|
| 46 | + if (isset($_REQUEST['PHP_INFO'])) { |
|
| 47 | 47 | phpinfo(); |
| 48 | 48 | exit(EXIT_SUCCESS); |
| 49 | 49 | } |
@@ -226,9 +226,9 @@ discard block |
||
| 226 | 226 | if (is_numeric(key($code))) { |
| 227 | 227 | $message = reset($code); |
| 228 | 228 | $code = key($code); |
| 229 | - } elseif (isset($code[ 'code' ])) { |
|
| 230 | - $code = $code[ 'code' ]; |
|
| 231 | - $message = $code[ 'message' ]; |
|
| 229 | + } elseif (isset($code['code'])) { |
|
| 230 | + $code = $code['code']; |
|
| 231 | + $message = $code['message']; |
|
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | |
@@ -271,17 +271,17 @@ discard block |
||
| 271 | 271 | // set php runtime to unlimited |
| 272 | 272 | set_time_limit(0); |
| 273 | 273 | |
| 274 | - $longPoolingCacheKey = 'long-pooling-' . session()->get('id'); |
|
| 274 | + $longPoolingCacheKey = 'long-pooling-'.session()->get('id'); |
|
| 275 | 275 | $longPoolingCacheData = null; |
| 276 | 276 | |
| 277 | - if ( ! cache()->hasItem($longPoolingCacheKey)) { |
|
| 277 | + if (!cache()->hasItem($longPoolingCacheKey)) { |
|
| 278 | 278 | cache()->save(new Item($longPoolingCacheKey, $data)); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | // main loop |
| 282 | 282 | while (true) { |
| 283 | 283 | // if ajax request has send a timestamp, then $lastCallTimestamp = timestamp, else $last_call = null |
| 284 | - $lastCallTimestamp = (int)input()->getPost('last_call_timestamp'); |
|
| 284 | + $lastCallTimestamp = (int) input()->getPost('last_call_timestamp'); |
|
| 285 | 285 | |
| 286 | 286 | // PHP caches file data, like requesting the size of a file, by default. clearstatcache() clears that cache |
| 287 | 287 | clearstatcache(); |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | $longPoolingCacheMetadata = $longPoolingCacheData->getMetadata(); |
| 295 | 295 | |
| 296 | 296 | // if no timestamp delivered via ajax or data.txt has been changed SINCE last ajax timestamp |
| 297 | - if ($lastCallTimestamp == null || $longPoolingCacheMetadata[ 'ctime' ] > $lastCallTimestamp) { |
|
| 297 | + if ($lastCallTimestamp == null || $longPoolingCacheMetadata['ctime'] > $lastCallTimestamp) { |
|
| 298 | 298 | output()->send([ |
| 299 | 299 | 'timestamp' => $longPoolingCacheMetadata, |
| 300 | 300 | 'data' => $data, |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function index($code = 500) |
| 33 | 33 | { |
| 34 | - $codeString = $code . '_' . error_code_string($code); |
|
| 34 | + $codeString = $code.'_'.error_code_string($code); |
|
| 35 | 35 | |
| 36 | 36 | if (presenter()->theme->use === true) { |
| 37 | 37 | presenter()->theme->setLayout('error'); |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | view('error-code', [ |
| 47 | 47 | 'code' => $code, |
| 48 | - 'title' => language()->getLine($codeString . '_TITLE'), |
|
| 49 | - 'message' => language()->getLine($codeString . '_MESSAGE'), |
|
| 48 | + 'title' => language()->getLine($codeString.'_TITLE'), |
|
| 49 | + 'message' => language()->getLine($codeString.'_MESSAGE'), |
|
| 50 | 50 | ]); |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | \ No newline at end of file |
@@ -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') { |
@@ -39,6 +39,6 @@ discard block |
||
| 39 | 39 | return models('controller'); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - return $get[ $property ]; |
|
| 42 | + return $get[$property]; |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | \ No newline at end of file |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $item = new SplArrayObject(); |
| 52 | 52 | foreach ($fields as $field) { |
| 53 | 53 | if ($row->offsetExists($field)) { |
| 54 | - $item[ $field ] = $row->offsetGet($field); |
|
| 54 | + $item[$field] = $row->offsetGet($field); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | $chunks = array_chunk($this->storage, $entries); |
| 78 | 78 | $offset = $page - 1; |
| 79 | 79 | |
| 80 | - if (isset($chunks[ $offset ])) { |
|
| 81 | - $result = new ArrayIterator($chunks[ $offset ]); |
|
| 80 | + if (isset($chunks[$offset])) { |
|
| 81 | + $result = new ArrayIterator($chunks[$offset]); |
|
| 82 | 82 | |
| 83 | 83 | if (empty($fields)) { |
| 84 | 84 | return $this->result = $result; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $item = new SplArrayObject(); |
| 88 | 88 | foreach ($fields as $field) { |
| 89 | 89 | if ($row->offsetExists($field)) { |
| 90 | - $item[ $field ] = $row->offsetGet($field); |
|
| 90 | + $item[$field] = $row->offsetGet($field); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | $counter = 0; |
| 262 | 262 | foreach ($this->storage as $row) { |
| 263 | 263 | if ($row->offsetExists($field)) { |
| 264 | - if ( ! in_array($row->offsetGet($field), $notInCriteria)) { |
|
| 264 | + if (!in_array($row->offsetGet($field), $notInCriteria)) { |
|
| 265 | 265 | $result[] = $row; |
| 266 | 266 | $counter++; |
| 267 | 267 | } |