@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | loader()->addNamespace($reflection->name, $subModelPath); |
| 157 | 157 | |
| 158 | 158 | foreach (glob($subModelPath . '*.php') as $filepath) { |
| 159 | - $this->validSubModels[ strtolower(pathinfo($filepath, PATHINFO_FILENAME)) ] = $filepath; |
|
| 159 | + $this->validSubModels[strtolower(pathinfo($filepath, PATHINFO_FILENAME))] = $filepath; |
|
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | } |
@@ -183,24 +183,24 @@ 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 ])) { |
|
| 203 | + if (is_file($this->validSubModels[$model])) { |
|
| 204 | 204 | $className = '\\' . get_called_class() . '\\' . ucfirst($model); |
| 205 | 205 | $className = str_replace('\Base\\Model', '\Models', $className); |
| 206 | 206 | |
@@ -163,7 +163,7 @@ discard block |
||
| 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 | } |
@@ -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)) { |
@@ -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; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | if (count($subPackages)) { |
| 135 | 135 | |
| 136 | 136 | if (array_key_exists('libraries', $subPackages)) { |
| 137 | - foreach ($subPackages[ 'libraries' ] as $subPackageFile) { |
|
| 137 | + foreach ($subPackages['libraries'] as $subPackageFile) { |
|
| 138 | 138 | $pluginDir = $packageDir . 'libraries' . DIRECTORY_SEPARATOR; |
| 139 | 139 | $pluginName = $subPackageFile; |
| 140 | 140 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - unset($subPackages[ 'libraries' ]); |
|
| 148 | + unset($subPackages['libraries']); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $this->head->loadFile($packageDir . $package . '.css'); |
@@ -400,19 +400,19 @@ discard block |
||
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | // Valet path fixes |
| 403 | - if (isset($_SERVER[ 'SCRIPT_FILENAME' ])) { |
|
| 404 | - $valetPath = dirname($_SERVER[ 'SCRIPT_FILENAME' ]) . DIRECTORY_SEPARATOR; |
|
| 403 | + if (isset($_SERVER['SCRIPT_FILENAME'])) { |
|
| 404 | + $valetPath = dirname($_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPARATOR; |
|
| 405 | 405 | } else { |
| 406 | - $PATH_ROOT = $_SERVER[ 'DOCUMENT_ROOT' ]; |
|
| 407 | - |
|
| 408 | - if (isset($_SERVER[ 'PHP_SELF' ])) { |
|
| 409 | - $valetPath = $PATH_ROOT . dirname($_SERVER[ 'PHP_SELF' ]) . DIRECTORY_SEPARATOR; |
|
| 410 | - } elseif (isset($_SERVER[ 'DOCUMENT_URI' ])) { |
|
| 411 | - $valetPath = $PATH_ROOT . dirname($_SERVER[ 'DOCUMENT_URI' ]) . DIRECTORY_SEPARATOR; |
|
| 412 | - } elseif (isset($_SERVER[ 'REQUEST_URI' ])) { |
|
| 413 | - $valetPath = $PATH_ROOT . dirname($_SERVER[ 'REQUEST_URI' ]) . DIRECTORY_SEPARATOR; |
|
| 414 | - } elseif (isset($_SERVER[ 'SCRIPT_NAME' ])) { |
|
| 415 | - $valetPath = $PATH_ROOT . dirname($_SERVER[ 'SCRIPT_NAME' ]) . DIRECTORY_SEPARATOR; |
|
| 406 | + $PATH_ROOT = $_SERVER['DOCUMENT_ROOT']; |
|
| 407 | + |
|
| 408 | + if (isset($_SERVER['PHP_SELF'])) { |
|
| 409 | + $valetPath = $PATH_ROOT . dirname($_SERVER['PHP_SELF']) . DIRECTORY_SEPARATOR; |
|
| 410 | + } elseif (isset($_SERVER['DOCUMENT_URI'])) { |
|
| 411 | + $valetPath = $PATH_ROOT . dirname($_SERVER['DOCUMENT_URI']) . DIRECTORY_SEPARATOR; |
|
| 412 | + } elseif (isset($_SERVER['REQUEST_URI'])) { |
|
| 413 | + $valetPath = $PATH_ROOT . dirname($_SERVER['REQUEST_URI']) . DIRECTORY_SEPARATOR; |
|
| 414 | + } elseif (isset($_SERVER['SCRIPT_NAME'])) { |
|
| 415 | + $valetPath = $PATH_ROOT . dirname($_SERVER['SCRIPT_NAME']) . DIRECTORY_SEPARATOR; |
|
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | |
@@ -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 | } |
@@ -36,23 +36,23 @@ |
||
| 36 | 36 | $name = []; |
| 37 | 37 | |
| 38 | 38 | if (count($parts) == 1) { |
| 39 | - $name[ 'first' ] = $parts[ 0 ]; |
|
| 40 | - $name[ 'middle' ] = null; |
|
| 41 | - $name[ 'last' ] = null; |
|
| 39 | + $name['first'] = $parts[0]; |
|
| 40 | + $name['middle'] = null; |
|
| 41 | + $name['last'] = null; |
|
| 42 | 42 | } elseif (count($parts) == 2) { |
| 43 | - $name[ 'first' ] = $parts[ 0 ]; |
|
| 44 | - $name[ 'middle' ] = null; |
|
| 45 | - $name[ 'last' ] = $parts[ 1 ]; |
|
| 43 | + $name['first'] = $parts[0]; |
|
| 44 | + $name['middle'] = null; |
|
| 45 | + $name['last'] = $parts[1]; |
|
| 46 | 46 | } elseif (count($parts) == 3) { |
| 47 | - $name[ 'first' ] = $parts[ 0 ]; |
|
| 48 | - $name[ 'middle' ] = $parts[ 1 ]; |
|
| 49 | - $name[ 'last' ] = $parts[ 2 ]; |
|
| 47 | + $name['first'] = $parts[0]; |
|
| 48 | + $name['middle'] = $parts[1]; |
|
| 49 | + $name['last'] = $parts[2]; |
|
| 50 | 50 | } else { |
| 51 | - $name[ 'first' ] = $parts[ 0 ]; |
|
| 52 | - $name[ 'middle' ] = $parts[ 1 ]; |
|
| 51 | + $name['first'] = $parts[0]; |
|
| 52 | + $name['middle'] = $parts[1]; |
|
| 53 | 53 | |
| 54 | 54 | $parts = array_slice($parts, 2); |
| 55 | - $name[ 'last' ] = implode(' ', $parts); |
|
| 55 | + $name['last'] = implode(' ', $parts); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -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 | |
@@ -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 |
@@ -111,24 +111,24 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $this->imageFilePath = $this->imageNotFoundFilename; |
| 113 | 113 | |
| 114 | - $this->imageSize[ 'width' ] = $this->input->get('width'); |
|
| 115 | - $this->imageSize[ 'height' ] = $this->input->get('height'); |
|
| 114 | + $this->imageSize['width'] = $this->input->get('width'); |
|
| 115 | + $this->imageSize['height'] = $this->input->get('height'); |
|
| 116 | 116 | $this->imageScale = $this->input->get('scale'); |
| 117 | 117 | $this->imageQuality = $this->input->get('quality'); |
| 118 | 118 | $this->imageCrop = $this->input->get('crop'); |
| 119 | 119 | |
| 120 | 120 | if (false !== ($key = array_search('crop', $segments))) { |
| 121 | 121 | $this->imageCrop = true; |
| 122 | - unset($segments[ $key ]); |
|
| 122 | + unset($segments[$key]); |
|
| 123 | 123 | $segments = array_values($segments); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (count($segments) == 1) { |
| 127 | 127 | $this->imageFilePath = $this->storagePath . end($segments); |
| 128 | 128 | } elseif (count($segments) >= 2) { |
| 129 | - if (preg_match("/(\d+)(x)(\d+)/", $segments[ count($segments) - 2 ], $matches)) { |
|
| 130 | - $this->imageSize[ 'width' ] = $matches[ 1 ]; |
|
| 131 | - $this->imageSize[ 'height' ] = $matches[ 3 ]; |
|
| 129 | + if (preg_match("/(\d+)(x)(\d+)/", $segments[count($segments) - 2], $matches)) { |
|
| 130 | + $this->imageSize['width'] = $matches[1]; |
|
| 131 | + $this->imageSize['height'] = $matches[3]; |
|
| 132 | 132 | |
| 133 | 133 | if (count($segments) == 2) { |
| 134 | 134 | $this->imageFilePath = $this->storagePath . end($segments); |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | array_slice($segments, 0, |
| 138 | 138 | count($segments) - 2)) . DIRECTORY_SEPARATOR . end($segments); |
| 139 | 139 | } |
| 140 | - } elseif (preg_match("/(\d+)(p)/", $segments[ count($segments) - 2 ], |
|
| 141 | - $matches) or is_numeric($segments[ count($segments) - 2 ]) |
|
| 140 | + } elseif (preg_match("/(\d+)(p)/", $segments[count($segments) - 2], |
|
| 141 | + $matches) or is_numeric($segments[count($segments) - 2]) |
|
| 142 | 142 | ) { |
| 143 | - $this->imageScale = isset($matches[ 1 ]) ? $matches[ 1 ] : $segments[ count($segments) - 2 ]; |
|
| 143 | + $this->imageScale = isset($matches[1]) ? $matches[1] : $segments[count($segments) - 2]; |
|
| 144 | 144 | if (count($segments) == 2) { |
| 145 | 145 | $this->imageFilePath = $this->storagePath . end($segments); |
| 146 | 146 | } else { |
@@ -154,14 +154,14 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | $imageFilePath = $this->imageFilePath; |
| 157 | - $extensions[ 0 ] = pathinfo($imageFilePath, PATHINFO_EXTENSION); |
|
| 157 | + $extensions[0] = pathinfo($imageFilePath, PATHINFO_EXTENSION); |
|
| 158 | 158 | |
| 159 | 159 | for ($i = 0; $i < 2; $i++) { |
| 160 | 160 | $extension = pathinfo($imageFilePath, PATHINFO_EXTENSION); |
| 161 | 161 | |
| 162 | 162 | if ($extension !== '') { |
| 163 | - $extensions[ $i ] = $extension; |
|
| 164 | - $imageFilePath = str_replace('.' . $extensions[ $i ], '', $imageFilePath); |
|
| 163 | + $extensions[$i] = $extension; |
|
| 164 | + $imageFilePath = str_replace('.' . $extensions[$i], '', $imageFilePath); |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
@@ -173,13 +173,13 @@ discard block |
||
| 173 | 173 | ]; |
| 174 | 174 | |
| 175 | 175 | if (count($extensions) == 2) { |
| 176 | - $this->imageFilePath = $imageFilePath . '.' . $extensions[ 1 ]; |
|
| 176 | + $this->imageFilePath = $imageFilePath . '.' . $extensions[1]; |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | if (array_key_exists($extension = reset($extensions), $mimes)) { |
| 180 | - $this->imageFileMime = $mimes[ $extension ]; |
|
| 180 | + $this->imageFileMime = $mimes[$extension]; |
|
| 181 | 181 | } elseif (array_key_exists($extension = pathinfo($this->imageFilePath, PATHINFO_EXTENSION), $mimes)) { |
| 182 | - $this->imageFileMime = $mimes[ $extension ]; |
|
| 182 | + $this->imageFileMime = $mimes[$extension]; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | if ( ! is_file($this->imageFilePath)) { |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | if ( ! empty($this->imageScale)) { |
| 190 | 190 | $this->scale(); |
| 191 | - } elseif ( ! empty($this->imageSize[ 'width' ]) || ! empty($this->imageSize[ 'height' ])) { |
|
| 191 | + } elseif ( ! empty($this->imageSize['width']) || ! empty($this->imageSize['height'])) { |
|
| 192 | 192 | $this->resize(); |
| 193 | 193 | } else { |
| 194 | 194 | $this->original(); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | } else { |
| 279 | 279 | $manipulation = new Manipulation($config); |
| 280 | 280 | $manipulation->setImageFile($this->imageFilePath); |
| 281 | - $manipulation->resizeImage($this->imageSize[ 'width' ], $this->imageSize[ 'height' ], |
|
| 281 | + $manipulation->resizeImage($this->imageSize['width'], $this->imageSize['height'], |
|
| 282 | 282 | (bool)$this->imageCrop); |
| 283 | 283 | $cacheItemPool->save(new Item($cacheImageKey, $manipulation->getBlobImage(), false)); |
| 284 | 284 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | |
| 292 | 292 | $manipulation = new Manipulation($config); |
| 293 | 293 | $manipulation->setImageFile($this->imageFilePath); |
| 294 | - $manipulation->resizeImage($this->imageSize[ 'width' ], $this->imageSize[ 'height' ], (bool)$this->imageCrop); |
|
| 294 | + $manipulation->resizeImage($this->imageSize['width'], $this->imageSize['height'], (bool)$this->imageCrop); |
|
| 295 | 295 | $manipulation->displayImage(intval($this->imageQuality), $this->imageFileMime); |
| 296 | 296 | exit(EXIT_SUCCESS); |
| 297 | 297 | } |