@@ -28,7 +28,7 @@ |
||
| 28 | 28 | if (in_array($code, array_keys(Response::HTTP_STATUS_CODES))) { |
| 29 | 29 | |
| 30 | 30 | header('HTTP/2 ' . $code . ' ' . Response::HTTP_STATUS_CODES[$code]); |
| 31 | - header('Location: ' . $location); |
|
| 31 | + header('Location: ' . $location); |
|
| 32 | 32 | return $this->terminate(); |
| 33 | 33 | |
| 34 | 34 | } |
@@ -50,11 +50,11 @@ |
||
| 50 | 50 | |
| 51 | 51 | if (strpos($args[$i], '-') === false) { |
| 52 | 52 | continue; |
| 53 | - } else if (empty($args[$i+1])) { |
|
| 53 | + } else if (empty($args[$i + 1])) { |
|
| 54 | 54 | break; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $this->set(str_replace('-', '', $args[$i]), $args[$i+1]); |
|
| 57 | + $this->set(str_replace('-', '', $args[$i]), $args[$i + 1]); |
|
| 58 | 58 | |
| 59 | 59 | } |
| 60 | 60 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function getVariable($key) |
| 113 | 113 | { |
| 114 | - if(isset($this->variable[$key])) { |
|
| 114 | + if (isset($this->variable[$key])) { |
|
| 115 | 115 | return $this->variable[$key]; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function hasVariable(string $key) :bool |
| 127 | 127 | { |
| 128 | - if(isset($this->variable[$key])) { |
|
| 128 | + if (isset($this->variable[$key])) { |
|
| 129 | 129 | return true; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | public function setVariables(array $variables = []) :self |
| 141 | 141 | { |
| 142 | - foreach($variables AS $key=>$value) { |
|
| 142 | + foreach ($variables AS $key=>$value) { |
|
| 143 | 143 | $this->setVariable($key, $value); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | ob_end_clean(); |
| 204 | 204 | |
| 205 | - if( $this->getExtendedTemplate() instanceof ViewController ) { |
|
| 205 | + if ($this->getExtendedTemplate() instanceof ViewController) { |
|
| 206 | 206 | return $this->cleanOutput($this->getExtendedTemplate()->setVariables($this->getVariables())->render()); |
| 207 | 207 | } else { |
| 208 | 208 | return $this->cleanOutput($content); |
@@ -251,8 +251,8 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | public function __destruct() |
| 253 | 253 | { |
| 254 | - unset( $this->variable ); |
|
| 255 | - unset( $this->template ); |
|
| 254 | + unset($this->variable); |
|
| 255 | + unset($this->template); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | } |
| 259 | 259 | \ No newline at end of file |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | public function render($template = '', array $variables = []) |
| 56 | 56 | { |
| 57 | 57 | $view = new ViewController(); |
| 58 | - $view->setTemplate( $template ); |
|
| 59 | - $view->setVariables( $variables ); |
|
| 58 | + $view->setTemplate($template); |
|
| 59 | + $view->setVariables($variables); |
|
| 60 | 60 | return $view->render(); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -101,10 +101,10 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function renderBlock(string $name, string $default = '') |
| 103 | 103 | { |
| 104 | - if($this->view->getVariable($name) == null) { |
|
| 104 | + if ($this->view->getVariable($name) == null) { |
|
| 105 | 105 | return $default; |
| 106 | 106 | } |
| 107 | - return trim($this->view->getVariable( $name )); |
|
| 107 | + return trim($this->view->getVariable($name)); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** @var array $files */ |
| 143 | - $files = $this->view->getVariable('assets'.ucfirst($type)); |
|
| 143 | + $files = $this->view->getVariable('assets' . ucfirst($type)); |
|
| 144 | 144 | |
| 145 | 145 | foreach ($files AS $file) { |
| 146 | 146 | $result .= sprintf($pattern, $file) . "\n"; |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | if ($routeName === $name) { |
| 223 | 223 | |
| 224 | - $path = preg_replace('|/\((.*)\)|', '', $data['path']);; |
|
| 224 | + $path = preg_replace('|/\((.*)\)|', '', $data['path']); ; |
|
| 225 | 225 | break; |
| 226 | 226 | } |
| 227 | 227 | |