@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function getVariable($key) |
| 119 | 119 | { |
| 120 | - if(isset($this->variable[$key])) { |
|
| 120 | + if (isset($this->variable[$key])) { |
|
| 121 | 121 | return $this->variable[$key]; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function hasVariable(string $key) :bool |
| 133 | 133 | { |
| 134 | - if(isset($this->variable[$key])) { |
|
| 134 | + if (isset($this->variable[$key])) { |
|
| 135 | 135 | return true; |
| 136 | 136 | } |
| 137 | 137 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function setVariables(array $variables = []) :self |
| 147 | 147 | { |
| 148 | - foreach($variables AS $key=>$value) { |
|
| 148 | + foreach ($variables AS $key=>$value) { |
|
| 149 | 149 | $this->setVariable($key, $value); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | ob_end_clean(); |
| 207 | 207 | |
| 208 | - if( $this->getParentTemplate() instanceof ViewController ) { |
|
| 208 | + if ($this->getParentTemplate() instanceof ViewController) { |
|
| 209 | 209 | return $this->cleanOutput($this->getParentTemplate()->setVariables($this->getVariables())->render()); |
| 210 | 210 | } else { |
| 211 | 211 | return $this->cleanOutput($content); |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | public function __destruct() |
| 255 | 255 | { |
| 256 | - unset( $this->variable ); |
|
| 257 | - unset( $this->template ); |
|
| 256 | + unset($this->variable); |
|
| 257 | + unset($this->template); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | } |
| 261 | 261 | \ No newline at end of file |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function __invoke(ViewController $view, string $block, string $defaultValue = '') |
| 27 | 27 | { |
| 28 | - if($view->getVariable($block) === '') { |
|
| 28 | + if ($view->getVariable($block) === '') { |
|
| 29 | 29 | return $defaultValue; |
| 30 | 30 | } |
| 31 | 31 | return trim($view->getVariable($block)); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** @var array $files */ |
| 43 | - $files = $view->getVariable('assets'.ucfirst($type)); |
|
| 43 | + $files = $view->getVariable('assets' . ucfirst($type)); |
|
| 44 | 44 | |
| 45 | 45 | foreach ($files AS $file) { |
| 46 | 46 | $result .= sprintf($pattern, $file) . "\n"; |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | foreach ($routes as $routeName => $data) { |
| 40 | 40 | |
| 41 | 41 | if ($routeName === $name) { |
| 42 | - $path = preg_replace('|/\((.*)\)|', '', $data['path']);; |
|
| 42 | + $path = preg_replace('|/\((.*)\)|', '', $data['path']); ; |
|
| 43 | 43 | break; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | public function __invoke(ViewController $view, string $template = '', array $variables = []) |
| 27 | 27 | { |
| 28 | 28 | $view = new ViewController(); |
| 29 | - $view->setTemplate( $template ); |
|
| 30 | - $view->setVariables( $variables ); |
|
| 29 | + $view->setTemplate($template); |
|
| 30 | + $view->setVariables($variables); |
|
| 31 | 31 | return $view->render(); |
| 32 | 32 | } |
| 33 | 33 | |