@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | ]); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $update[ 'id' ] = $row->id; |
|
| 89 | + $update['id'] = $row->id; |
|
| 90 | 90 | |
| 91 | 91 | if ($this->hasChilds($row->id)) { |
| 92 | 92 | $right = $this->rebuildTree($row->id, $right, $depth + 1); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | ->update($update = [ |
| 97 | 97 | 'record_right' => $right, |
| 98 | 98 | ]); |
| 99 | - $update[ 'id' ] = $row->id; |
|
| 99 | + $update['id'] = $row->id; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $i++; |
@@ -32,16 +32,16 @@ |
||
| 32 | 32 | { |
| 33 | 33 | $money = []; |
| 34 | 34 | if (is_numeric($amount)) { |
| 35 | - $money[ 'amount' ] = (int)$amount; |
|
| 35 | + $money['amount'] = (int)$amount; |
|
| 36 | 36 | } elseif (is_array($amount)) { |
| 37 | 37 | $money = $amount; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - (int)$storage[ 'amount' ] = 0; |
|
| 41 | - $storage[ 'currency' ] = config()->getItem('units')->currency; |
|
| 40 | + (int)$storage['amount'] = 0; |
|
| 41 | + $storage['currency'] = config()->getItem('units')->currency; |
|
| 42 | 42 | |
| 43 | 43 | $storage = array_merge($storage, $money); |
| 44 | - (int)$storage[ 'amount' ] = empty($storage[ 'amount' ]) ? 0 : abs($storage[ 'amount' ]); |
|
| 44 | + (int)$storage['amount'] = empty($storage['amount']) ? 0 : abs($storage['amount']); |
|
| 45 | 45 | |
| 46 | 46 | $this->storage = $storage; |
| 47 | 47 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | if (is_file($bundleFontFilePath . '.map')) { |
| 82 | 82 | $bundleFontMap = json_decode(file_get_contents($bundleFontFilePath . '.map'), true); |
| 83 | 83 | // if the file version is changed delete it first |
| 84 | - if ( ! hash_equals($bundleFontVersion, $bundleFontMap[ 'version' ])) { |
|
| 84 | + if ( ! hash_equals($bundleFontVersion, $bundleFontMap['version'])) { |
|
| 85 | 85 | unlink($bundleFontFilePath); |
| 86 | 86 | unlink($bundleFontFilePath . '.map'); |
| 87 | 87 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | flock($bundleFileStream, LOCK_EX); |
| 98 | 98 | |
| 99 | 99 | foreach ($this->font as $font) { |
| 100 | - $bundleFontMap[ 'sources' ][] = $font; |
|
| 100 | + $bundleFontMap['sources'][] = $font; |
|
| 101 | 101 | fwrite($bundleFileStream, file_get_contents($font)); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | if (is_file($bundleCssFilePath . '.map')) { |
| 148 | 148 | $bundleCssMap = json_decode(file_get_contents($bundleCssFilePath . '.map'), true); |
| 149 | 149 | // if the file version is changed delete it first |
| 150 | - if ( ! hash_equals($bundleCssVersion, $bundleCssMap[ 'version' ])) { |
|
| 150 | + if ( ! hash_equals($bundleCssVersion, $bundleCssMap['version'])) { |
|
| 151 | 151 | unlink($bundleCssFilePath); |
| 152 | 152 | unlink($bundleCssFilePath . '.map'); |
| 153 | 153 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | foreach ($this->css as $css) { |
| 166 | 166 | if ( ! in_array(pathinfo($css, PATHINFO_FILENAME), $unbundledFilename)) { |
| 167 | - $bundleCssMap[ 'sources' ][] = $css; |
|
| 167 | + $bundleCssMap['sources'][] = $css; |
|
| 168 | 168 | fwrite($bundleFileStream, file_get_contents($css)); |
| 169 | 169 | } |
| 170 | 170 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | if (is_file($bundleJsFilePath . '.map')) { |
| 214 | 214 | $bundleJsMap = json_decode(file_get_contents($bundleJsFilePath . '.map'), true); |
| 215 | 215 | // if the file version is changed delete it first |
| 216 | - if ( ! hash_equals($bundleJsVersion, $bundleJsMap[ 'version' ])) { |
|
| 216 | + if ( ! hash_equals($bundleJsVersion, $bundleJsMap['version'])) { |
|
| 217 | 217 | unlink($bundleJsFilePath); |
| 218 | 218 | unlink($bundleJsFilePath . '.map'); |
| 219 | 219 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | foreach ($this->css as $css) { |
| 232 | 232 | if ( ! in_array(pathinfo($css, PATHINFO_FILENAME), $unbundledFilename)) { |
| 233 | - $bundleJsMap[ 'sources' ][] = $css; |
|
| 233 | + $bundleJsMap['sources'][] = $css; |
|
| 234 | 234 | fwrite($bundleFileStream, file_get_contents($css)); |
| 235 | 235 | } |
| 236 | 236 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | if (is_file($bundleJsFilePath . '.map')) { |
| 73 | 73 | $bundleJsMap = json_decode(file_get_contents($bundleJsFilePath . '.map'), true); |
| 74 | 74 | // if the file version is changed delete it first |
| 75 | - if ( ! hash_equals($bundleJsVersion, $bundleJsMap[ 'version' ])) { |
|
| 75 | + if ( ! hash_equals($bundleJsVersion, $bundleJsMap['version'])) { |
|
| 76 | 76 | unlink($bundleJsFilePath); |
| 77 | 77 | unlink($bundleJsFilePath . '.map'); |
| 78 | 78 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | foreach ($this->javascript as $javascript) { |
| 91 | 91 | if ( ! in_array(pathinfo($javascript, PATHINFO_FILENAME), $unbundledFilename)) { |
| 92 | - $bundleJsMap[ 'sources' ][] = $javascript; |
|
| 92 | + $bundleJsMap['sources'][] = $javascript; |
|
| 93 | 93 | fwrite($bundleFileStream, file_get_contents($javascript)); |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $element = new Element('meta'); |
| 78 | 78 | |
| 79 | - $element->attributes[ 'name' ] = 'fb:app_id'; |
|
| 80 | - $element->attributes[ 'content' ] = $appId; |
|
| 79 | + $element->attributes['name'] = 'fb:app_id'; |
|
| 80 | + $element->attributes['content'] = $appId; |
|
| 81 | 81 | |
| 82 | 82 | parent::offsetSet('fb:app_id', $element); |
| 83 | 83 | |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $property = 'og:' . $property; |
| 118 | 118 | $element = new Element('meta'); |
| 119 | 119 | |
| 120 | - $element->attributes[ 'name' ] = $property; |
|
| 121 | - $element->attributes[ 'content' ] = (is_array($content) ? implode(', ', $content) : trim($content)); |
|
| 120 | + $element->attributes['name'] = $property; |
|
| 121 | + $element->attributes['content'] = (is_array($content) ? implode(', ', $content) : trim($content)); |
|
| 122 | 122 | |
| 123 | 123 | parent::offsetSet($property, $element); |
| 124 | 124 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | } else { |
| 65 | 65 | $uriPath = urldecode( |
| 66 | - parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH) |
|
| 66 | + parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) |
|
| 67 | 67 | ); |
| 68 | 68 | |
| 69 | 69 | $uriPathParts = explode('public/', $uriPath); |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | if (class_exists($controllerClassName)) { |
| 260 | 260 | $this->addresses->any( |
| 261 | 261 | '/', |
| 262 | - function () use ($controllerClassName) { |
|
| 262 | + function() use ($controllerClassName) { |
|
| 263 | 263 | return new $controllerClassName(); |
| 264 | 264 | } |
| 265 | 265 | ); |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | if (class_exists($controllerClassName)) { |
| 275 | 275 | $this->addresses->any( |
| 276 | 276 | '/', |
| 277 | - function () use ($controllerClassName) { |
|
| 277 | + function() use ($controllerClassName) { |
|
| 278 | 278 | return new $controllerClassName(); |
| 279 | 279 | } |
| 280 | 280 | ); |
@@ -326,8 +326,8 @@ discard block |
||
| 326 | 326 | ); |
| 327 | 327 | } elseif (preg_match("/([a-zA-Z0-9\\\]+)(@)([a-zA-Z0-9\\\]+)/", $closure, $matches)) { |
| 328 | 328 | $this->setController( |
| 329 | - (new KernelControllerDatastructure($matches[ 1 ])) |
|
| 330 | - ->setRequestMethod($matches[ 3 ]), |
|
| 329 | + (new KernelControllerDatastructure($matches[1])) |
|
| 330 | + ->setRequestMethod($matches[3]), |
|
| 331 | 331 | $uriSegments |
| 332 | 332 | ); |
| 333 | 333 | } elseif (presenter()->theme->use === true) { |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // autoload presenter assets |
| 108 | - if (isset($config[ 'assets' ])) { |
|
| 109 | - $this->assets->autoload($config[ 'assets' ]); |
|
| 108 | + if (isset($config['assets'])) { |
|
| 109 | + $this->assets->autoload($config['assets']); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | // autoload presenter theme |
| 113 | - if (isset($config[ 'theme' ])) { |
|
| 114 | - if (false !== ($theme = $config[ 'theme' ])) { |
|
| 113 | + if (isset($config['theme'])) { |
|
| 114 | + if (false !== ($theme = $config['theme'])) { |
|
| 115 | 115 | $this->setTheme($theme); |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -190,25 +190,25 @@ discard block |
||
| 190 | 190 | $storage = $this->storage; |
| 191 | 191 | |
| 192 | 192 | // Add Properties |
| 193 | - $storage[ 'meta' ] = $this->meta; |
|
| 194 | - $storage[ 'page' ] = $this->page; |
|
| 195 | - $storage[ 'assets' ] = new SplArrayObject([ |
|
| 193 | + $storage['meta'] = $this->meta; |
|
| 194 | + $storage['page'] = $this->page; |
|
| 195 | + $storage['assets'] = new SplArrayObject([ |
|
| 196 | 196 | 'head' => $this->assets->getHead(), |
| 197 | 197 | 'body' => $this->assets->getBody(), |
| 198 | 198 | ]); |
| 199 | - $storage[ 'partials' ] = $this->partials; |
|
| 200 | - $storage[ 'widgets' ] = $this->widgets; |
|
| 201 | - $storage[ 'theme' ] = $this->theme; |
|
| 199 | + $storage['partials'] = $this->partials; |
|
| 200 | + $storage['widgets'] = $this->widgets; |
|
| 201 | + $storage['theme'] = $this->theme; |
|
| 202 | 202 | |
| 203 | 203 | // Add Services |
| 204 | - $storage[ 'config' ] = config(); |
|
| 205 | - $storage[ 'language' ] = language(); |
|
| 206 | - $storage[ 'session' ] = session(); |
|
| 207 | - $storage[ 'presenter' ] = presenter(); |
|
| 208 | - $storage[ 'input' ] = input(); |
|
| 204 | + $storage['config'] = config(); |
|
| 205 | + $storage['language'] = language(); |
|
| 206 | + $storage['session'] = session(); |
|
| 207 | + $storage['presenter'] = presenter(); |
|
| 208 | + $storage['input'] = input(); |
|
| 209 | 209 | |
| 210 | 210 | if (services()->has('csrfProtection')) { |
| 211 | - $storage[ 'csrfToken' ] = services()->get('csrfProtection')->getToken(); |
|
| 211 | + $storage['csrfToken'] = services()->get('csrfProtection')->getToken(); |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | return $storage; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | ); |
| 73 | 73 | |
| 74 | 74 | if ($this->config->offsetExists('extensions')) { |
| 75 | - $this->setFileExtensions($this->config[ 'extensions' ]); |
|
| 75 | + $this->setFileExtensions($this->config['extensions']); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $this->document = new Html\Document(); |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function &__get($property) |
| 90 | 90 | { |
| 91 | - $get[ $property ] = false; |
|
| 91 | + $get[$property] = false; |
|
| 92 | 92 | |
| 93 | 93 | if (property_exists($this, $property)) { |
| 94 | 94 | return $this->{$property}; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - return $get[ $property ]; |
|
| 97 | + return $get[$property]; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // ------------------------------------------------------------------------ |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | $error = new ErrorException( |
| 206 | 206 | 'E_VIEW_NOT_FOUND', |
| 207 | 207 | 0, |
| 208 | - @$backtrace[ 0 ][ 'file' ], |
|
| 209 | - @$backtrace[ 0 ][ 'line' ], |
|
| 208 | + @$backtrace[0]['file'], |
|
| 209 | + @$backtrace[0]['line'], |
|
| 210 | 210 | [trim($filename)] |
| 211 | 211 | ); |
| 212 | 212 | |
@@ -455,12 +455,12 @@ discard block |
||
| 455 | 455 | $htmlOutput = $this->document->saveHTML(); |
| 456 | 456 | |
| 457 | 457 | // Uglify Output |
| 458 | - if ($this->config->output[ 'uglify' ] === true) { |
|
| 458 | + if ($this->config->output['uglify'] === true) { |
|
| 459 | 459 | $htmlOutput = preg_replace( |
| 460 | 460 | [ |
| 461 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
| 462 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
| 463 | - '/(\s)+/s', // shorten multiple whitespace sequences |
|
| 461 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
| 462 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
| 463 | + '/(\s)+/s', // shorten multiple whitespace sequences |
|
| 464 | 464 | '/<!--(.|\s)*?-->/', // Remove HTML comments |
| 465 | 465 | '/<!--(.*)-->/Uis', |
| 466 | 466 | "/[[:blank:]]+/", |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | // Beautify Output |
| 480 | - if ($this->config->output[ 'beautify' ] === true) { |
|
| 480 | + if ($this->config->output['beautify'] === true) { |
|
| 481 | 481 | $beautifier = new Html\Dom\Beautifier(); |
| 482 | 482 | $htmlOutput = $beautifier->format($htmlOutput); |
| 483 | 483 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function &__get($property) |
| 35 | 35 | { |
| 36 | - $get[ $property ] = false; |
|
| 36 | + $get[$property] = false; |
|
| 37 | 37 | |
| 38 | 38 | // CodeIgniter property aliasing |
| 39 | 39 | if ($property === 'load') { |
@@ -41,15 +41,15 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | if (services()->has($property)) { |
| 44 | - $get[ $property ] = services()->get($property); |
|
| 44 | + $get[$property] = services()->get($property); |
|
| 45 | 45 | } elseif (o2system()->__isset($property)) { |
| 46 | - $get[ $property ] = o2system()->__get($property); |
|
| 46 | + $get[$property] = o2system()->__get($property); |
|
| 47 | 47 | } elseif ($property === 'model') { |
| 48 | - $get[ $property ] = models('controller'); |
|
| 48 | + $get[$property] = models('controller'); |
|
| 49 | 49 | } elseif ($property === 'services' || $property === 'libraries') { |
| 50 | - $get[ $property ] = services(); |
|
| 50 | + $get[$property] = services(); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - return $get[ $property ]; |
|
| 53 | + return $get[$property]; |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | \ No newline at end of file |