@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | if (services()->has('csrfProtection')) { |
38 | 38 | if (hash_equals(input()->server('REQUEST_METHOD'), 'POST')) { |
39 | - if (!services()->get('csrfProtection')->verify()) { |
|
39 | + if ( ! services()->get('csrfProtection')->verify()) { |
|
40 | 40 | output()->sendError(403, [ |
41 | 41 | 'message' => language()->getLine('403_INVALID_CSRF') |
42 | 42 | ]); |
@@ -37,8 +37,8 @@ |
||
37 | 37 | $config = presenter()->getConfig('assets'); |
38 | 38 | |
39 | 39 | $webpack = false; |
40 | - if (isset($config[ 'webpack' ])) { |
|
41 | - $webpack = (bool)$config[ 'webpack' ]; |
|
40 | + if (isset($config['webpack'])) { |
|
41 | + $webpack = (bool)$config['webpack']; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $output = []; |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | { |
34 | 34 | // Create Page breadcrumbs |
35 | 35 | $breadcrumb = new Breadcrumb(); |
36 | - $breadcrumb->createList( new Link( language()->getLine( 'HOME' ), base_url() ) ); |
|
37 | - $this->store( 'breadcrumb', $breadcrumb ); |
|
36 | + $breadcrumb->createList(new Link(language()->getLine('HOME'), base_url())); |
|
37 | + $this->store('breadcrumb', $breadcrumb); |
|
38 | 38 | |
39 | 39 | // Store Page Uri |
40 | 40 | $uri = new Uri(); |
41 | - $this->store( 'uri', $uri ); |
|
41 | + $this->store('uri', $uri); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | // ------------------------------------------------------------------------ |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @return static |
52 | 52 | */ |
53 | - public function setHeader( $header ) |
|
53 | + public function setHeader($header) |
|
54 | 54 | { |
55 | - $header = trim( $header ); |
|
56 | - $this->store( 'header', $header ); |
|
57 | - presenter()->meta->offsetSet( 'subtitle', $header ); |
|
58 | - presenter()->meta->title->append( $header ); |
|
55 | + $header = trim($header); |
|
56 | + $this->store('header', $header); |
|
57 | + presenter()->meta->offsetSet('subtitle', $header); |
|
58 | + presenter()->meta->title->append($header); |
|
59 | 59 | |
60 | 60 | return $this; |
61 | 61 | } |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @return static |
71 | 71 | */ |
72 | - public function setSubHeader( $subHeader ) |
|
72 | + public function setSubHeader($subHeader) |
|
73 | 73 | { |
74 | - $this->store( 'subHeader', trim( $subHeader ) ); |
|
74 | + $this->store('subHeader', trim($subHeader)); |
|
75 | 75 | |
76 | 76 | return $this; |
77 | 77 | } |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return static |
87 | 87 | */ |
88 | - public function setDescription( $description ) |
|
88 | + public function setDescription($description) |
|
89 | 89 | { |
90 | - $description = trim( $description ); |
|
91 | - $this->store( 'description', $description ); |
|
90 | + $description = trim($description); |
|
91 | + $this->store('description', $description); |
|
92 | 92 | |
93 | 93 | return $this; |
94 | 94 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | define('PATH_THEME', $this->active->getRealPath()); |
40 | 40 | } |
41 | 41 | |
42 | - if(services()->has('view')) { |
|
42 | + if (services()->has('view')) { |
|
43 | 43 | // add theme view directory |
44 | 44 | view()->addFilePath($this->active->getRealPath()); |
45 | 45 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $uriRoutedSegments = array_diff($uriSegments, |
96 | 96 | array_slice($uriSegments, ($uriTotalSegments - $i))); |
97 | 97 | |
98 | - if (!empty($app)) { |
|
98 | + if ( ! empty($app)) { |
|
99 | 99 | if (reset($uriSegments) !== $app->getParameter()) { |
100 | 100 | array_unshift($uriRoutedSegments, $app->getParameter()); |
101 | 101 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | // Try to translate from uri string |
117 | 117 | if (false !== ($action = $this->addresses->getTranslation($uriString))) { |
118 | - if (!$action->isValidHttpMethod(input()->server('REQUEST_METHOD')) && !$action->isAnyHttpMethod()) { |
|
118 | + if ( ! $action->isValidHttpMethod(input()->server('REQUEST_METHOD')) && ! $action->isAnyHttpMethod()) { |
|
119 | 119 | output()->sendError(405); |
120 | 120 | } else { |
121 | 121 | if (false !== ($parseSegments = $action->getParseUriString($this->uri->getSegments()->getString()))) { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $uriString = $this->uri->getSegments()->getString(); |
129 | 129 | |
130 | 130 | $this->parseAction($action, $uriSegments); |
131 | - if (!empty(services()->has('controller'))) { |
|
131 | + if ( ! empty(services()->has('controller'))) { |
|
132 | 132 | return true; |
133 | 133 | } |
134 | 134 | } |
@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | $reconfig = true; |
234 | 234 | } |
235 | 235 | |
236 | - if (!$reconfig) { |
|
236 | + if ( ! $reconfig) { |
|
237 | 237 | $controllerNamespace = $module->getNamespace() . 'Controllers\\'; |
238 | 238 | $controllerClassName = $controllerNamespace . studlycase($module->getParameter()); |
239 | 239 | |
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 | ); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | if (class_exists($controllerClassName)) { |
256 | 256 | $this->addresses->any( |
257 | 257 | '/', |
258 | - function () use ($controllerClassName) { |
|
258 | + function() use ($controllerClassName) { |
|
259 | 259 | return new $controllerClassName(); |
260 | 260 | } |
261 | 261 | ); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $uriSegments |
303 | 303 | ); |
304 | 304 | } elseif (presenter()->theme->use === true) { |
305 | - if (!presenter()->partials->offsetExists('content') && $closure !== '') { |
|
305 | + if ( ! presenter()->partials->offsetExists('content') && $closure !== '') { |
|
306 | 306 | presenter()->partials->offsetSet('content', $closure); |
307 | 307 | } |
308 | 308 |
@@ -60,12 +60,12 @@ |
||
60 | 60 | $properties = file_get_contents($propertiesFilePath); |
61 | 61 | $properties = json_decode($properties, true); |
62 | 62 | |
63 | - if (isset($properties[ 'vars' ])) { |
|
64 | - $this->vars = $properties[ 'vars' ]; |
|
63 | + if (isset($properties['vars'])) { |
|
64 | + $this->vars = $properties['vars']; |
|
65 | 65 | } |
66 | 66 | |
67 | - if (isset($properties[ 'presets' ])) { |
|
68 | - $this->presets = new SplArrayObject($properties[ 'presets' ]); |
|
67 | + if (isset($properties['presets'])) { |
|
68 | + $this->presets = new SplArrayObject($properties['presets']); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | } |