Passed
Push — master ( d24b5a...841428 )
by Henri
01:17
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 HelperTrait, CheckTrait;
7 7
 
8 8
     private static $instance = null;
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
     public static function getInstance(string $path): Viewer
18 18
     {
19
-        if(is_null(self::$instance)){
19
+        if (is_null(self::$instance)) {
20 20
             self::$instance = new self($path);
21 21
         }
22 22
         return self::$instance;
@@ -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
         
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         $this->saveData();
45 45
 
46
-        if(!$return){
46
+        if (!$return) {
47 47
             echo $buffer;
48 48
             return '';
49 49
         }
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
     public function include(string $file): void
55 55
     {
56 56
         $buffer = '';
57
-        try{
57
+        try {
58 58
             $buffer = $this->getOB($this->path.$file.'.tpl.php');
59 59
             $buffer = $this->getVars($buffer);
60
-        }catch(\Exception $er){
60
+        }catch (\Exception $er) {
61 61
             $buffer = "<div class='view error'>Component error: {$er->getMessage()}</div>";
62 62
         }
63 63
         echo $buffer;
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         try{
58 58
             $buffer = $this->getOB($this->path.$file.'.tpl.php');
59 59
             $buffer = $this->getVars($buffer);
60
-        }catch(\Exception $er){
60
+        } catch(\Exception $er){
61 61
             $buffer = "<div class='view error'>Component error: {$er->getMessage()}</div>";
62 62
         }
63 63
         echo $buffer;
Please login to merge, or discard this patch.