@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | // autoload presenter assets |
58 | 58 | if ($config->offsetExists('assets')) { |
59 | - $this->assets->autoload($config->assets[ 'autoload' ]); |
|
59 | + $this->assets->autoload($config->assets['autoload']); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // autoload presenter theme |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | // autoload presenter manifest |
69 | - if($config->offsetExists('manifest')) { |
|
69 | + if ($config->offsetExists('manifest')) { |
|
70 | 70 | $manifest = $config->offsetGet('manifest'); |
71 | 71 | |
72 | - foreach($manifest as $offset => $value) { |
|
73 | - if(empty($value)) { |
|
72 | + foreach ($manifest as $offset => $value) { |
|
73 | + if (empty($value)) { |
|
74 | 74 | continue; |
75 | 75 | } |
76 | 76 | |
77 | - if($offset === 'icons') { |
|
77 | + if ($offset === 'icons') { |
|
78 | 78 | $value = array_values($value); |
79 | 79 | } |
80 | 80 | |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | $storage = $this->storage; |
92 | 92 | |
93 | 93 | // Add Services |
94 | - $storage[ 'config' ] = config(); |
|
95 | - $storage[ 'language' ] = language(); |
|
96 | - $storage[ 'session' ] = session(); |
|
97 | - $storage[ 'presenter' ] = presenter(); |
|
98 | - $storage[ 'input' ] = input(); |
|
94 | + $storage['config'] = config(); |
|
95 | + $storage['language'] = language(); |
|
96 | + $storage['session'] = session(); |
|
97 | + $storage['presenter'] = presenter(); |
|
98 | + $storage['input'] = input(); |
|
99 | 99 | |
100 | 100 | // Add Container |
101 | - $storage[ 'globals' ] = globals(); |
|
101 | + $storage['globals'] = globals(); |
|
102 | 102 | |
103 | 103 | return $storage; |
104 | 104 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | return models('controller'); |
119 | 119 | } elseif ($property === 'services' || $property === 'libraries') { |
120 | 120 | return services(); |
121 | - } elseif( method_exists($this, $property) ) { |
|
121 | + } elseif (method_exists($this, $property)) { |
|
122 | 122 | return call_user_func([&$this, $property]); |
123 | 123 | } |
124 | 124 |
@@ -60,12 +60,12 @@ |
||
60 | 60 | $props = file_get_contents($propsFilePath); |
61 | 61 | $props = json_decode($props, true); |
62 | 62 | |
63 | - if (isset($props[ 'vars' ])) { |
|
64 | - $this->vars = $props[ 'vars' ]; |
|
63 | + if (isset($props['vars'])) { |
|
64 | + $this->vars = $props['vars']; |
|
65 | 65 | } |
66 | 66 | |
67 | - if (isset($props[ 'settings' ])) { |
|
68 | - $this->settings = new SplArrayObject($props[ 'settings' ]); |
|
67 | + if (isset($props['settings'])) { |
|
68 | + $this->settings = new SplArrayObject($props['settings']); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | public function &__get($property) |
26 | 26 | { |
27 | - $get[ $property ] = false; |
|
27 | + $get[$property] = false; |
|
28 | 28 | |
29 | 29 | // CodeIgniter property aliasing |
30 | 30 | if ($property === 'load') { |
@@ -32,15 +32,15 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | if (o2system()->hasService($property)) { |
35 | - $get[ $property ] = o2system()->getService($property); |
|
35 | + $get[$property] = o2system()->getService($property); |
|
36 | 36 | } elseif (o2system()->__isset($property)) { |
37 | - $get[ $property ] = o2system()->__get($property); |
|
37 | + $get[$property] = o2system()->__get($property); |
|
38 | 38 | } elseif ($property === 'model') { |
39 | - $get[ $property ] = models('controller'); |
|
39 | + $get[$property] = models('controller'); |
|
40 | 40 | } elseif ($property === 'services' || $property === 'libraries') { |
41 | - $get[ $property ] = services(); |
|
41 | + $get[$property] = services(); |
|
42 | 42 | } |
43 | 43 | |
44 | - return $get[ $property ]; |
|
44 | + return $get[$property]; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | \ No newline at end of file |
@@ -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()); |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | $uriSegments = $uri->getSegments()->getParts(); |
32 | 32 | $uriString = $uri->getSegments()->getString(); |
33 | 33 | |
34 | - if($uriSegmentKey = array_search('manifest.json', $uriSegments)) { |
|
34 | + if ($uriSegmentKey = array_search('manifest.json', $uriSegments)) { |
|
35 | 35 | $uriSegments[$uriSegmentKey] = 'manifest'; |
36 | 36 | } |
37 | 37 | |
38 | 38 | if (empty($uriSegments)) { |
39 | 39 | $uriPath = urldecode( |
40 | - parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH) |
|
40 | + parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) |
|
41 | 41 | ); |
42 | 42 | |
43 | 43 | $uriPathParts = explode('public/', $uriPath); |
@@ -79,15 +79,15 @@ discard block |
||
79 | 79 | $uriRoutedSegments = array_diff($uriSegments, |
80 | 80 | array_slice($uriSegments, ($uriTotalSegments - $i))); |
81 | 81 | |
82 | - if(!empty($app)) { |
|
83 | - if(reset($uriSegments) !== $app->getParameter()) { |
|
82 | + if ( ! empty($app)) { |
|
83 | + if (reset($uriSegments) !== $app->getParameter()) { |
|
84 | 84 | array_unshift($uriRoutedSegments, $app->getParameter()); |
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | 88 | if (false !== ($module = modules()->getModule($uriRoutedSegments))) { |
89 | 89 | $uriSegments = array_diff($uriSegments, $uriRoutedSegments); |
90 | - if(empty($uriSegments)) { |
|
90 | + if (empty($uriSegments)) { |
|
91 | 91 | $uriSegments = []; |
92 | 92 | $uriString = '/'; |
93 | 93 | } else { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
184 | - if(class_exists($controllerClassName = modules()->current()->getDefaultControllerClassName())) { |
|
184 | + if (class_exists($controllerClassName = modules()->current()->getDefaultControllerClassName())) { |
|
185 | 185 | $this->setController(new Kernel\Http\Router\Datastructures\Controller($controllerClassName), |
186 | 186 | $uriSegments); |
187 | 187 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | if (class_exists($controllerClassName)) { |
226 | 226 | $this->addresses->any( |
227 | 227 | '/', |
228 | - function () use ($controllerClassName) { |
|
228 | + function() use ($controllerClassName) { |
|
229 | 229 | return new $controllerClassName(); |
230 | 230 | } |
231 | 231 | ); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | if (class_exists($controllerClassName)) { |
241 | 241 | $this->addresses->any( |
242 | 242 | '/', |
243 | - function () use ($controllerClassName) { |
|
243 | + function() use ($controllerClassName) { |
|
244 | 244 | return new $controllerClassName(); |
245 | 245 | } |
246 | 246 | ); |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | ); |
283 | 283 | } elseif (preg_match("/([a-zA-Z0-9\\\]+)(@)([a-zA-Z0-9\\\]+)/", $closure, $matches)) { |
284 | 284 | $this->setController( |
285 | - (new Kernel\Http\Router\Datastructures\Controller($matches[ 1 ])) |
|
286 | - ->setRequestMethod($matches[ 3 ]), |
|
285 | + (new Kernel\Http\Router\Datastructures\Controller($matches[1])) |
|
286 | + ->setRequestMethod($matches[3]), |
|
287 | 287 | $uriSegments |
288 | 288 | ); |
289 | 289 | } elseif (presenter()->theme->use === true) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | ); |
75 | 75 | |
76 | 76 | if ($this->config->offsetExists('extensions')) { |
77 | - $this->setFileExtensions($this->config[ 'extensions' ]); |
|
77 | + $this->setFileExtensions($this->config['extensions']); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | $this->document = new Html\Document(); |
@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function &__get($property) |
92 | 92 | { |
93 | - $get[ $property ] = false; |
|
93 | + $get[$property] = false; |
|
94 | 94 | |
95 | 95 | if (property_exists($this, $property)) { |
96 | 96 | return $this->{$property}; |
97 | 97 | } |
98 | 98 | |
99 | - return $get[ $property ]; |
|
99 | + return $get[$property]; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | public function parse($string, array $vars = []) |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | $error = new ErrorException( |
154 | 154 | 'E_VIEW_NOT_FOUND', |
155 | 155 | 0, |
156 | - @$backtrace[ 0 ][ 'file' ], |
|
157 | - @$backtrace[ 0 ][ 'line' ], |
|
156 | + @$backtrace[0]['file'], |
|
157 | + @$backtrace[0]['line'], |
|
158 | 158 | [trim($filename)] |
159 | 159 | ); |
160 | 160 | |
@@ -404,9 +404,9 @@ discard block |
||
404 | 404 | if ($this->config->output->minify === true) { |
405 | 405 | $htmlOutput = preg_replace( |
406 | 406 | [ |
407 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
408 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
409 | - '/(\s)+/s', // shorten multiple whitespace sequences |
|
407 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
408 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
409 | + '/(\s)+/s', // shorten multiple whitespace sequences |
|
410 | 410 | '/<!--(.|\s)*?-->/', // Remove HTML comments |
411 | 411 | '/<!--(.*)-->/Uis', |
412 | 412 | "/[[:blank:]]+/", |
@@ -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 |