Passed
Push — master ( 28d65c...255af9 )
by Henri
01:23
created
src/Viewer.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace HnrAzevedo\Viewer;
4 4
 
5
-class Viewer{
5
+class Viewer {
6 6
     use EspecialHelperTrait, CheckTrait;
7 7
 
8 8
     private static $instance = null;
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
     public static function getInstance(string $path): Viewer
17 17
     {
18
-        if(is_null(self::$instance)){
18
+        if (is_null(self::$instance)) {
19 19
             self::$instance = new self();
20 20
         }
21 21
         self::$instance->path = $path;
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function render(string $file, array $data = [], bool $return = false): string
31 31
     {
32
-        if(!headers_sent()){
32
+        if (!headers_sent()) {
33 33
             header('Content-Type: text/html; charset=utf-8');
34 34
         }
35 35
         
36 36
         $this->check_viewExist($file);
37 37
 
38
-        $buffer = $this->getOB($this->path . DIRECTORY_SEPARATOR . $file . '.view.php', $data);
38
+        $buffer = $this->getOB($this->path.DIRECTORY_SEPARATOR.$file.'.view.php', $data);
39 39
         
40 40
         $buffer = $this->getVars($buffer);
41 41
         $buffer = $this->getEspecialVars($buffer);
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
         $this->saveData();
46 46
 
47
-        if(!$return){
47
+        if (!$return) {
48 48
             echo $buffer;
49 49
             return '';
50 50
         }
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
     public function include(string $file): void
56 56
     {
57 57
         $buffer = '';
58
-        try{
58
+        try {
59 59
             $buffer = $this->getOB($this->path.$file.'.inc.php');
60 60
             $buffer = $this->getVars($buffer);
61 61
             $buffer = $this->getEspecialVars($buffer);
62
-        }catch(\Exception $er){
62
+        }catch (\Exception $er) {
63 63
             $buffer = "<div class='view error'>Component error: {$er->getMessage()}</div>";
64 64
         }
65 65
         echo $buffer;
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
             $buffer = $this->getOB($this->path.$file.'.inc.php');
60 60
             $buffer = $this->getVars($buffer);
61 61
             $buffer = $this->getEspecialVars($buffer);
62
-        }catch(\Exception $er){
62
+        } catch(\Exception $er){
63 63
             $buffer = "<div class='view error'>Component error: {$er->getMessage()}</div>";
64 64
         }
65 65
         echo $buffer;
Please login to merge, or discard this patch.