@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Phauthentic\Presentation\View\Exception; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Phauthentic\Presentation\Renderer; |
| 5 | 5 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $path = $view->templatePath(); |
| 43 | 43 | $path = Utility::sanitizePath($path); |
| 44 | 44 | |
| 45 | - $template = $this->templateRoot . DIRECTORY_SEPARATOR . $path . $view->template() . '.php'; |
|
| 45 | + $template = $this->templateRoot.DIRECTORY_SEPARATOR.$path.$view->template().'.php'; |
|
| 46 | 46 | |
| 47 | 47 | if (!is_file($template)) { |
| 48 | 48 | throw MissingTemplateException::missingFile($template); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Phauthentic\Presentation\Renderer; |
| 5 | 5 | |
@@ -102,10 +102,10 @@ discard block |
||
| 102 | 102 | $path = $view->templatePath(); |
| 103 | 103 | $path = Utility::sanitizePath($path); |
| 104 | 104 | |
| 105 | - $template = $this->templateRoot . DIRECTORY_SEPARATOR . $path . $view->template() . '.html'; |
|
| 105 | + $template = $this->templateRoot.DIRECTORY_SEPARATOR.$path.$view->template().'.html'; |
|
| 106 | 106 | |
| 107 | 107 | if (!is_file($template)) { |
| 108 | - throw new MissingTemplateException('Template file missing: ' . $template); |
|
| 108 | + throw new MissingTemplateException('Template file missing: '.$template); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $template; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | $tmpDir = sys_get_temp_dir(); |
| 120 | 120 | $templateHash = hash_file('sha1', $template); |
| 121 | - $cachedTemplateFile = $tmpDir . DIRECTORY_SEPARATOR . sha1($template) . '-' . $templateHash; |
|
| 121 | + $cachedTemplateFile = $tmpDir.DIRECTORY_SEPARATOR.sha1($template).'-'.$templateHash; |
|
| 122 | 122 | |
| 123 | 123 | if (!file_exists($cachedTemplateFile)) { |
| 124 | 124 | $templateString = file_get_contents($template); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | 'flags' => $this->flags, |
| 127 | 127 | 'helpers' => $this->helpers |
| 128 | 128 | ]); |
| 129 | - file_put_contents($cachedTemplateFile, '<?php ' . $phpTemplateString . '?>'); |
|
| 129 | + file_put_contents($cachedTemplateFile, '<?php '.$phpTemplateString.'?>'); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | ob_start(); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Phauthentic\Presentation\Renderer\Exception; |
| 5 | 5 | |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | class MissingTemplateException extends RendererException |
| 10 | 10 | { |
| 11 | - public static function missingFile(string $file ) { |
|
| 12 | - return new self('Template file missing: ' . $file); |
|
| 11 | + public static function missingFile(string $file) { |
|
| 12 | + return new self('Template file missing: '.$file); |
|
| 13 | 13 | } |
| 14 | 14 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Phauthentic\Presentation\Renderer; |
| 5 | 5 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function render(ViewInterface $view): string |
| 52 | 52 | { |
| 53 | - $template = $this->twig->load($view->template() . '.' . $this->getTemplateExtension()); |
|
| 53 | + $template = $this->twig->load($view->template().'.'.$this->getTemplateExtension()); |
|
| 54 | 54 | |
| 55 | 55 | return $template->render($view->viewVars()); |
| 56 | 56 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Phauthentic\Presentation\Renderer; |
| 5 | 5 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $path = $view->templatePath(); |
| 95 | 95 | $path = $this->sanitizePath($path); |
| 96 | 96 | |
| 97 | - $template = $this->templateRoot . DIRECTORY_SEPARATOR . $path . $view->template() . '.' . $this->extension; |
|
| 97 | + $template = $this->templateRoot.DIRECTORY_SEPARATOR.$path.$view->template().'.'.$this->extension; |
|
| 98 | 98 | |
| 99 | 99 | if (!is_file($template)) { |
| 100 | 100 | throw MissingTemplateException::missingFile($template); |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function getTemplatePathFromRequest(ServerRequestInterface $request): string |
| 93 | 93 | { |
| 94 | - $module = (string)$request->getAttribute('module'); |
|
| 95 | - $component = (string)$request->getAttribute('component'); |
|
| 94 | + $module = (string) $request->getAttribute('module'); |
|
| 95 | + $component = (string) $request->getAttribute('component'); |
|
| 96 | 96 | |
| 97 | 97 | $module = empty($module) ? '' : $module; |
| 98 | 98 | $component = empty($component) ? 'default' : $component; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | if (!empty($module)) { |
| 108 | - return $module . DIRECTORY_SEPARATOR . $component; |
|
| 108 | + return $module.DIRECTORY_SEPARATOR.$component; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $component; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function getTemplateFromRequest(ServerRequestInterface $request): string |
| 120 | 120 | { |
| 121 | - $action = (string)$request->getAttribute('action'); |
|
| 121 | + $action = (string) $request->getAttribute('action'); |
|
| 122 | 122 | |
| 123 | 123 | if (empty($action)) { |
| 124 | 124 | trigger_error( |