@@ -56,24 +56,24 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $this->imageFilePath = $this->imageNotFound; |
| 58 | 58 | |
| 59 | - $this->imageSize[ 'width' ] = input()->get('width'); |
|
| 60 | - $this->imageSize[ 'height' ] = input()->get('height'); |
|
| 59 | + $this->imageSize['width'] = input()->get('width'); |
|
| 60 | + $this->imageSize['height'] = input()->get('height'); |
|
| 61 | 61 | $this->imageScale = input()->get('scale'); |
| 62 | 62 | $this->imageQuality = input()->get('quality'); |
| 63 | 63 | $this->imageCrop = input()->get('crop'); |
| 64 | 64 | |
| 65 | 65 | if (false !== ($key = array_search('crop', $segments))) { |
| 66 | 66 | $this->imageCrop = true; |
| 67 | - unset($segments[ $key ]); |
|
| 67 | + unset($segments[$key]); |
|
| 68 | 68 | $segments = array_values($segments); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | if (count($segments) == 1) { |
| 72 | 72 | $this->imageFilePath = $this->imagePath . end($segments); |
| 73 | 73 | } elseif (count($segments) >= 2) { |
| 74 | - if (preg_match("/(\d+)(x)(\d+)/", $segments[ count($segments) - 2 ], $matches)) { |
|
| 75 | - $this->imageSize[ 'width' ] = $matches[ 1 ]; |
|
| 76 | - $this->imageSize[ 'height' ] = $matches[ 3 ]; |
|
| 74 | + if (preg_match("/(\d+)(x)(\d+)/", $segments[count($segments) - 2], $matches)) { |
|
| 75 | + $this->imageSize['width'] = $matches[1]; |
|
| 76 | + $this->imageSize['height'] = $matches[3]; |
|
| 77 | 77 | |
| 78 | 78 | if (count($segments) == 2) { |
| 79 | 79 | $this->imageFilePath = $this->imagePath . end($segments); |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | array_slice($segments, 0, |
| 83 | 83 | count($segments) - 2)) . DIRECTORY_SEPARATOR . end($segments); |
| 84 | 84 | } |
| 85 | - } elseif (preg_match("/(\d+)(p)/", $segments[ count($segments) - 2 ], |
|
| 86 | - $matches) or is_numeric($segments[ count($segments) - 2 ]) |
|
| 85 | + } elseif (preg_match("/(\d+)(p)/", $segments[count($segments) - 2], |
|
| 86 | + $matches) or is_numeric($segments[count($segments) - 2]) |
|
| 87 | 87 | ) { |
| 88 | - $this->imageScale = isset($matches[ 1 ]) ? $matches[ 1 ] : $segments[ count($segments) - 2 ]; |
|
| 88 | + $this->imageScale = isset($matches[1]) ? $matches[1] : $segments[count($segments) - 2]; |
|
| 89 | 89 | if (count($segments) == 2) { |
| 90 | 90 | $this->imageFilePath = $this->imagePath . end($segments); |
| 91 | 91 | } else { |
@@ -99,14 +99,14 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $imageFilePath = $this->imageFilePath; |
| 102 | - $extensions[ 0 ] = pathinfo($imageFilePath, PATHINFO_EXTENSION); |
|
| 102 | + $extensions[0] = pathinfo($imageFilePath, PATHINFO_EXTENSION); |
|
| 103 | 103 | |
| 104 | 104 | for ($i = 0; $i < 2; $i++) { |
| 105 | 105 | $extension = pathinfo($imageFilePath, PATHINFO_EXTENSION); |
| 106 | 106 | |
| 107 | 107 | if ($extension !== '') { |
| 108 | - $extensions[ $i ] = $extension; |
|
| 109 | - $imageFilePath = str_replace('.' . $extensions[ $i ], '', $imageFilePath); |
|
| 108 | + $extensions[$i] = $extension; |
|
| 109 | + $imageFilePath = str_replace('.' . $extensions[$i], '', $imageFilePath); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | ]; |
| 119 | 119 | |
| 120 | 120 | if (count($extensions) == 2) { |
| 121 | - $this->imageFilePath = $imageFilePath . '.' . $extensions[ 1 ]; |
|
| 121 | + $this->imageFilePath = $imageFilePath . '.' . $extensions[1]; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (array_key_exists($extension = reset($extensions), $mimes)) { |
| 125 | - $this->imageFileMime = $mimes[ $extension ]; |
|
| 125 | + $this->imageFileMime = $mimes[$extension]; |
|
| 126 | 126 | } elseif (array_key_exists($extension = pathinfo($this->imageFilePath, PATHINFO_EXTENSION), $mimes)) { |
| 127 | - $this->imageFileMime = $mimes[ $extension ]; |
|
| 127 | + $this->imageFileMime = $mimes[$extension]; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if ( ! is_file($this->imageFilePath)) { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | if ( ! empty($this->imageScale)) { |
| 135 | 135 | $this->scale(); |
| 136 | - } elseif ( ! empty($this->imageSize[ 'width' ]) || ! empty($this->imageSize[ 'height' ])) { |
|
| 136 | + } elseif ( ! empty($this->imageSize['width']) || ! empty($this->imageSize['height'])) { |
|
| 137 | 137 | $this->resize(); |
| 138 | 138 | } else { |
| 139 | 139 | $this->original(); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | } else { |
| 210 | 210 | $manipulation = new Manipulation($config); |
| 211 | 211 | $manipulation->setImageFile($this->imageFilePath); |
| 212 | - $manipulation->resizeImage($this->imageSize[ 'width' ], $this->imageSize[ 'height' ], |
|
| 212 | + $manipulation->resizeImage($this->imageSize['width'], $this->imageSize['height'], |
|
| 213 | 213 | (bool)$this->imageCrop); |
| 214 | 214 | $cacheItemPool->save(new Item($cacheImageKey, $manipulation->getBlobImage(), false)); |
| 215 | 215 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | $manipulation = new Manipulation($config); |
| 224 | 224 | $manipulation->setImageFile($this->imageFilePath); |
| 225 | - $manipulation->resizeImage($this->imageSize[ 'width' ], $this->imageSize[ 'height' ], (bool)$this->imageCrop); |
|
| 225 | + $manipulation->resizeImage($this->imageSize['width'], $this->imageSize['height'], (bool)$this->imageCrop); |
|
| 226 | 226 | $manipulation->displayImage(intval($this->imageQuality), $this->imageFileMime); |
| 227 | 227 | exit(EXIT_SUCCESS); |
| 228 | 228 | } |
@@ -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 | |
@@ -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, |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * @param $className |
| 19 | 19 | */ |
| 20 | 20 | spl_autoload_register( |
| 21 | - function ($className) { |
|
| 21 | + function($className) { |
|
| 22 | 22 | if ($className === 'O2System\Framework') { |
| 23 | 23 | require __DIR__ . DIRECTORY_SEPARATOR . 'Framework.php'; |
| 24 | 24 | } elseif (strpos($className, 'O2System\Framework\\') === false) { |
@@ -98,8 +98,8 @@ |
||
| 98 | 98 | |
| 99 | 99 | public function getNamespace() |
| 100 | 100 | { |
| 101 | - if (isset($this->properties[ 'namespace' ])) { |
|
| 102 | - return $this->properties[ 'namespace' ]; |
|
| 101 | + if (isset($this->properties['namespace'])) { |
|
| 102 | + return $this->properties['namespace']; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | $dir = $this->getRealPath(); |
@@ -165,7 +165,7 @@ |
||
| 165 | 165 | $themes = []; |
| 166 | 166 | foreach ($directory->getTree() as $themeName => $themeTree) { |
| 167 | 167 | if (($theme = $this->getTheme($themeName)) instanceof Theme) { |
| 168 | - $themes[ $themeName ] = $theme; |
|
| 168 | + $themes[$themeName] = $theme; |
|
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
@@ -15,16 +15,16 @@ |
||
| 15 | 15 | public function __construct($amount) |
| 16 | 16 | { |
| 17 | 17 | if (is_numeric($amount)) { |
| 18 | - $money[ 'amount' ] = (int)$amount; |
|
| 18 | + $money['amount'] = (int)$amount; |
|
| 19 | 19 | } elseif (is_array($amount)) { |
| 20 | 20 | $money = $amount; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - (int)$storage[ 'amount' ] = 0; |
|
| 24 | - $storage[ 'currency' ] = config()->getItem('units')->currency; |
|
| 23 | + (int)$storage['amount'] = 0; |
|
| 24 | + $storage['currency'] = config()->getItem('units')->currency; |
|
| 25 | 25 | |
| 26 | 26 | $storage = array_merge($storage, $money); |
| 27 | - (int)$storage[ 'amount' ] = empty($storage[ 'amount' ]) ? 0 : abs($storage[ 'amount' ]); |
|
| 27 | + (int)$storage['amount'] = empty($storage['amount']) ? 0 : abs($storage['amount']); |
|
| 28 | 28 | |
| 29 | 29 | $this->storage = $storage; |
| 30 | 30 | } |
@@ -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 | |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | $options = input()->get(); |
| 95 | 95 | |
| 96 | 96 | if (empty($options)) { |
| 97 | - $_GET[ 'host' ] = 'localhost'; |
|
| 98 | - $_GET[ 'port' ] = 8000; |
|
| 97 | + $_GET['host'] = 'localhost'; |
|
| 98 | + $_GET['port'] = 8000; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | parent::execute(); |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | ->setNewLinesAfter(1) |
| 108 | 108 | ); |
| 109 | 109 | |
| 110 | - $_SERVER[ 'DOCUMENT_ROOT' ] = PATH_PUBLIC; |
|
| 110 | + $_SERVER['DOCUMENT_ROOT'] = PATH_PUBLIC; |
|
| 111 | 111 | |
| 112 | 112 | output()->write( |
| 113 | 113 | (new Format()) |
| 114 | 114 | ->setContextualClass(Format::INFO) |
| 115 | - ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER[ 'DOCUMENT_ROOT' ]])) |
|
| 115 | + ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER['DOCUMENT_ROOT']])) |
|
| 116 | 116 | ->setNewLinesAfter(1) |
| 117 | 117 | ); |
| 118 | 118 | |
@@ -85,11 +85,11 @@ |
||
| 85 | 85 | $subNamespace |
| 86 | 86 | )) . '\\'; |
| 87 | 87 | |
| 88 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 89 | - $vars[ 'NAMESPACE' ] = trim($classNamespace, '\\'); |
|
| 90 | - $vars[ 'PACKAGE' ] = '\\' . trim($classNamespace, '\\'); |
|
| 91 | - $vars[ 'CLASS' ] = $className; |
|
| 92 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 88 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 89 | + $vars['NAMESPACE'] = trim($classNamespace, '\\'); |
|
| 90 | + $vars['PACKAGE'] = '\\' . trim($classNamespace, '\\'); |
|
| 91 | + $vars['CLASS'] = $className; |
|
| 92 | + $vars['FILEPATH'] = $filePath; |
|
| 93 | 93 | |
| 94 | 94 | $phpTemplate = <<<PHPTEMPLATE |
| 95 | 95 | <?php |