@@ -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 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | if ($cacheHandle instanceof \O2System\Psr\Cache\CacheItemPoolInterface) { |
47 | - if($cacheHandle->hasItem($cacheKey)) { |
|
47 | + if ($cacheHandle->hasItem($cacheKey)) { |
|
48 | 48 | output() |
49 | 49 | ->setContentType('text/html') |
50 | 50 | ->send($cacheHandle->getItem($cacheKey)->get()); |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | { |
49 | 49 | $element = new Element('meta'); |
50 | 50 | |
51 | - $element->attributes[ 'name' ] = 'fb:app_id'; |
|
52 | - $element->attributes[ 'content' ] = $appID; |
|
51 | + $element->attributes['name'] = 'fb:app_id'; |
|
52 | + $element->attributes['content'] = $appID; |
|
53 | 53 | |
54 | 54 | parent::offsetSet('fb:app_id', $element); |
55 | 55 | |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | $property = 'og:' . $property; |
71 | 71 | $element = new Element('meta'); |
72 | 72 | |
73 | - $element->attributes[ 'name' ] = $property; |
|
74 | - $element->attributes[ 'content' ] = (is_array($content) ? implode(', ', $content) : trim($content)); |
|
73 | + $element->attributes['name'] = $property; |
|
74 | + $element->attributes['content'] = (is_array($content) ? implode(', ', $content) : trim($content)); |
|
75 | 75 | |
76 | 76 | parent::offsetSet($property, $element); |
77 | 77 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | public function setName($name) |
30 | 30 | { |
31 | 31 | $xName = explode(' ', $name); |
32 | - $firstName = $xName[ 0 ]; |
|
32 | + $firstName = $xName[0]; |
|
33 | 33 | |
34 | 34 | array_shift($xName); |
35 | 35 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | if (isset($profile)) { |
32 | 32 | foreach ($profile->getArrayCopy() as $property => $element) { |
33 | 33 | $property = $this->namespace . ':' . $profile->namespace . ':' . $property; |
34 | - $element->attributes[ 'name' ] = $property; |
|
34 | + $element->attributes['name'] = $property; |
|
35 | 35 | $this->offsetSet($property, $element); |
36 | 36 | } |
37 | 37 | } |
@@ -33,8 +33,8 @@ |
||
33 | 33 | |
34 | 34 | $element = new Element('meta'); |
35 | 35 | |
36 | - $element->attributes[ 'name' ] = $property; |
|
37 | - $element->attributes[ 'content' ] = (is_array($content) ? implode(', ', $content) : trim($content)); |
|
36 | + $element->attributes['name'] = $property; |
|
37 | + $element->attributes['content'] = (is_array($content) ? implode(', ', $content) : trim($content)); |
|
38 | 38 | |
39 | 39 | $this->store($property, $element); |
40 | 40 |
@@ -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 |