@@ -365,12 +365,12 @@ discard block |
||
365 | 365 | $session->set('language', language()->getDefault()); |
366 | 366 | } |
367 | 367 | |
368 | - if (config('security')->protection[ 'csrf' ] === true) { |
|
368 | + if (config('security')->protection['csrf'] === true) { |
|
369 | 369 | $csrfProtection = new Security\Protections\Csrf(); |
370 | 370 | $this->services->add($csrfProtection, 'csrfProtection'); |
371 | 371 | } |
372 | 372 | |
373 | - if (config('security')->protection[ 'xss' ] === true) { |
|
373 | + if (config('security')->protection['xss'] === true) { |
|
374 | 374 | $xssProtection = new Security\Protections\Xss(); |
375 | 375 | $this->services->add($xssProtection, 'xssProtection'); |
376 | 376 | } |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | } elseif (is_serialized($requestControllerOutput)) { |
567 | 567 | output()->send($requestControllerOutput); |
568 | 568 | } elseif ($this->services->has('view')) { |
569 | - if($this->services->has('presenter')) { |
|
569 | + if ($this->services->has('presenter')) { |
|
570 | 570 | presenter()->partials->offsetSet('content', $requestControllerOutput); |
571 | 571 | } |
572 | 572 |
@@ -58,27 +58,27 @@ discard block |
||
58 | 58 | |
59 | 59 | // autoload presenter assets |
60 | 60 | if ($config->offsetExists('assets')) { |
61 | - $this->assets->autoload($config->assets[ 'autoload' ]); |
|
61 | + $this->assets->autoload($config->assets['autoload']); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // autoload presenter theme |
65 | 65 | if ($config->offsetExists('theme')) { |
66 | - if(false !== ($theme = $config->offsetGet('theme'))) { |
|
66 | + if (false !== ($theme = $config->offsetGet('theme'))) { |
|
67 | 67 | $this->theme->set($config->offsetGet('theme')); |
68 | 68 | $this->theme->load(); |
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | 72 | // autoload presenter manifest |
73 | - if($config->offsetExists('manifest')) { |
|
73 | + if ($config->offsetExists('manifest')) { |
|
74 | 74 | $manifest = $config->offsetGet('manifest'); |
75 | 75 | |
76 | - foreach($manifest as $offset => $value) { |
|
77 | - if(empty($value)) { |
|
76 | + foreach ($manifest as $offset => $value) { |
|
77 | + if (empty($value)) { |
|
78 | 78 | continue; |
79 | 79 | } |
80 | 80 | |
81 | - if($offset === 'icons') { |
|
81 | + if ($offset === 'icons') { |
|
82 | 82 | $value = array_values($value); |
83 | 83 | } |
84 | 84 | |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | $storage = $this->storage; |
96 | 96 | |
97 | 97 | // Add Services |
98 | - $storage[ 'config' ] = config(); |
|
99 | - $storage[ 'language' ] = language(); |
|
100 | - $storage[ 'session' ] = session(); |
|
101 | - $storage[ 'presenter' ] = presenter(); |
|
102 | - $storage[ 'input' ] = input(); |
|
98 | + $storage['config'] = config(); |
|
99 | + $storage['language'] = language(); |
|
100 | + $storage['session'] = session(); |
|
101 | + $storage['presenter'] = presenter(); |
|
102 | + $storage['input'] = input(); |
|
103 | 103 | |
104 | 104 | // Add Container |
105 | - $storage[ 'globals' ] = globals(); |
|
105 | + $storage['globals'] = globals(); |
|
106 | 106 | |
107 | 107 | if (services()->has('csrfProtection')) { |
108 | 108 | $storage['csrfToken'] = services()->get('csrfProtection')->getToken(); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | return models('controller'); |
125 | 125 | } elseif ($property === 'services' || $property === 'libraries') { |
126 | 126 | return services(); |
127 | - } elseif( method_exists($this, $property) ) { |
|
127 | + } elseif (method_exists($this, $property)) { |
|
128 | 128 | return call_user_func([&$this, $property]); |
129 | 129 | } |
130 | 130 |
@@ -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 |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | |
57 | 57 | // Render js |
58 | 58 | if ($this->javascript->count()) { |
59 | - foreach($this->javascript as $js) { |
|
60 | - if(in_array(pathinfo($js, PATHINFO_FILENAME), $unbundledFilename)) { |
|
59 | + foreach ($this->javascript as $js) { |
|
60 | + if (in_array(pathinfo($js, PATHINFO_FILENAME), $unbundledFilename)) { |
|
61 | 61 | $jsVersion = $this->getVersion($js); |
62 | 62 | $output[] = '<script type="text/javascript" src="' . $this->getUrl($js) . '?v=' . $jsVersion . '"></script>'; |
63 | 63 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if (is_file($bundleJsFilePath . '.map')) { |
73 | 73 | $bundleJsMap = json_decode(file_get_contents($bundleJsFilePath . '.map'), true); |
74 | 74 | // if the file version is changed delete it first |
75 | - if ( ! hash_equals($bundleJsVersion, $bundleJsMap[ 'version' ])) { |
|
75 | + if ( ! hash_equals($bundleJsVersion, $bundleJsMap['version'])) { |
|
76 | 76 | unlink($bundleJsFilePath); |
77 | 77 | unlink($bundleJsFilePath . '.map'); |
78 | 78 | } |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | flock($bundleFileStream, LOCK_EX); |
89 | 89 | |
90 | 90 | foreach ($this->javascript as $javascript) { |
91 | - if( ! in_array(pathinfo($javascript, PATHINFO_FILENAME), $unbundledFilename)) { |
|
92 | - $bundleJsMap[ 'sources' ][] = $javascript; |
|
91 | + if ( ! in_array(pathinfo($javascript, PATHINFO_FILENAME), $unbundledFilename)) { |
|
92 | + $bundleJsMap['sources'][] = $javascript; |
|
93 | 93 | fwrite($bundleFileStream, file_get_contents($javascript)); |
94 | 94 | } |
95 | 95 | } |