@@ -51,28 +51,28 @@ |
||
51 | 51 | $element = new Element('meta'); |
52 | 52 | |
53 | 53 | if ($offset === 'http-equiv') { |
54 | - $element->attributes[ 'http-equiv' ] = $value[ 'property' ]; |
|
55 | - $element->attributes[ 'content' ] = $value[ 'content' ]; |
|
56 | - parent::store(camelcase('http_equiv_' . $value[ 'property' ]), $element); |
|
54 | + $element->attributes['http-equiv'] = $value['property']; |
|
55 | + $element->attributes['content'] = $value['content']; |
|
56 | + parent::store(camelcase('http_equiv_' . $value['property']), $element); |
|
57 | 57 | } else { |
58 | - $element->attributes[ 'name' ] = $offset; |
|
58 | + $element->attributes['name'] = $offset; |
|
59 | 59 | |
60 | 60 | if (is_array($value)) { |
61 | 61 | if (is_numeric(key($value))) { |
62 | - $element->attributes[ 'content' ] = implode(', ', $value); |
|
62 | + $element->attributes['content'] = implode(', ', $value); |
|
63 | 63 | } else { |
64 | 64 | $newValue = []; |
65 | 65 | foreach ($value as $key => $val) { |
66 | 66 | $newValue[] = $key . '=' . $val; |
67 | 67 | } |
68 | - $element->attributes[ 'content' ] = implode(', ', $newValue); |
|
68 | + $element->attributes['content'] = implode(', ', $newValue); |
|
69 | 69 | } |
70 | 70 | } else { |
71 | - $element->attributes[ 'content' ] = $value; |
|
71 | + $element->attributes['content'] = $value; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | if (in_array($offset, ['description']) and $this->opengraph instanceof Meta\Opengraph) { |
75 | - $this->opengraph->setObject($element->attributes[ 'name' ], $element->attributes[ 'content' ]); |
|
75 | + $this->opengraph->setObject($element->attributes['name'], $element->attributes['content']); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | parent::store(camelcase($offset), $element); |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function __construct() |
154 | 154 | { |
155 | - if (isset($_SERVER[ 'HTTP_USER_AGENT' ])) { |
|
156 | - $this->string = trim($_SERVER[ 'HTTP_USER_AGENT' ]); |
|
155 | + if (isset($_SERVER['HTTP_USER_AGENT'])) { |
|
156 | + $this->string = trim($_SERVER['HTTP_USER_AGENT']); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | if ($this->string !== null && $this->loadAgentFile()) { |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | // Check for a specific browser |
273 | - return (isset(static::$browsers[ $key ]) && $this->browser === static::$browsers[ $key ]); |
|
273 | + return (isset(static::$browsers[$key]) && $this->browser === static::$browsers[$key]); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | // -------------------------------------------------------------------- |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | |
296 | 296 | // Check for a specific robot |
297 | - return (isset(static::$robots[ $key ]) && $this->robot === static::$robots[ $key ]); |
|
297 | + return (isset(static::$robots[$key]) && $this->robot === static::$robots[$key]); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | // -------------------------------------------------------------------- |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | } |
319 | 319 | |
320 | 320 | // Check for a specific robot |
321 | - return (isset(static::$mobiles[ $key ]) && $this->mobile === static::$mobiles[ $key ]); |
|
321 | + return (isset(static::$mobiles[$key]) && $this->mobile === static::$mobiles[$key]); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | // -------------------------------------------------------------------- |
@@ -331,10 +331,10 @@ discard block |
||
331 | 331 | public function isReferral() |
332 | 332 | { |
333 | 333 | if ( ! isset($this->referer)) { |
334 | - if (empty($_SERVER[ 'HTTP_REFERER' ])) { |
|
334 | + if (empty($_SERVER['HTTP_REFERER'])) { |
|
335 | 335 | $this->referer = false; |
336 | 336 | } else { |
337 | - $referer_host = @parse_url($_SERVER[ 'HTTP_REFERER' ], PHP_URL_HOST); |
|
337 | + $referer_host = @parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST); |
|
338 | 338 | $own_host = parse_url(o2system()->config->base_url(), PHP_URL_HOST); |
339 | 339 | |
340 | 340 | $this->referer = ($referer_host && $referer_host !== $own_host); |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | */ |
426 | 426 | public function referrer() |
427 | 427 | { |
428 | - return empty($_SERVER[ 'HTTP_REFERER' ]) ? '' : trim($_SERVER[ 'HTTP_REFERER' ]); |
|
428 | + return empty($_SERVER['HTTP_REFERER']) ? '' : trim($_SERVER['HTTP_REFERER']); |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | // -------------------------------------------------------------------- |
@@ -467,13 +467,13 @@ discard block |
||
467 | 467 | */ |
468 | 468 | protected function setLanguages() |
469 | 469 | { |
470 | - if ((count($this->languages) === 0) && ! empty($_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ])) { |
|
470 | + if ((count($this->languages) === 0) && ! empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
471 | 471 | $this->languages = explode( |
472 | 472 | ',', |
473 | 473 | preg_replace( |
474 | 474 | '/(;\s?q=[0-9\.]+)|\s/i', |
475 | 475 | '', |
476 | - strtolower(trim($_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ])) |
|
476 | + strtolower(trim($_SERVER['HTTP_ACCEPT_LANGUAGE'])) |
|
477 | 477 | ) |
478 | 478 | ); |
479 | 479 | } |
@@ -521,13 +521,13 @@ discard block |
||
521 | 521 | */ |
522 | 522 | protected function setCharsets() |
523 | 523 | { |
524 | - if ((count($this->charsets) === 0) && ! empty($_SERVER[ 'HTTP_ACCEPT_CHARSET' ])) { |
|
524 | + if ((count($this->charsets) === 0) && ! empty($_SERVER['HTTP_ACCEPT_CHARSET'])) { |
|
525 | 525 | $this->charsets = explode( |
526 | 526 | ',', |
527 | 527 | preg_replace( |
528 | 528 | '/(;\s?q=.+)|\s/i', |
529 | 529 | '', |
530 | - strtolower(trim($_SERVER[ 'HTTP_ACCEPT_CHARSET' ])) |
|
530 | + strtolower(trim($_SERVER['HTTP_ACCEPT_CHARSET'])) |
|
531 | 531 | ) |
532 | 532 | ); |
533 | 533 | } |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | foreach (static::$browsers as $key => $val) { |
579 | 579 | if (preg_match('|' . $key . '.*?([0-9\.]+)|i', $this->string, $match)) { |
580 | 580 | $this->isBrowser = true; |
581 | - $this->version = $match[ 1 ]; |
|
581 | + $this->version = $match[1]; |
|
582 | 582 | $this->browser = $val; |
583 | 583 | $this->setMobile(); |
584 | 584 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | if (false !== ($key = array_search('download', $segments))) { |
48 | 48 | $download = true; |
49 | - unset($segments[ $key ]); |
|
49 | + unset($segments[$key]); |
|
50 | 50 | $segments = array_values($segments); |
51 | 51 | } |
52 | 52 |
@@ -35,8 +35,8 @@ |
||
35 | 35 | |
36 | 36 | $viewFilePath = 'error-code'; |
37 | 37 | |
38 | - if(is_dir(modules()->current()->getDir('Views/errors'))) { |
|
39 | - $viewFilePath = 'errors/'.$viewFilePath; |
|
38 | + if (is_dir(modules()->current()->getDir('Views/errors'))) { |
|
39 | + $viewFilePath = 'errors/' . $viewFilePath; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | if (presenter()->theme->use === true) { |
@@ -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 |