Passed
Push — dev ( 712147...22d017 )
by Plamen
04:42
created
TraitHelper.php 1 patch
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 
18 18
     public static function assets($path = "/public/table")
19 19
     {
20
-        return "<script src=\"{$path}/table_helper.js\" defer></script>\n\t".
21
-            "<script src=\"{$path}/table.js\" defer></script>\n\t".
20
+        return "<script src=\"{$path}/table_helper.js\" defer></script>\n\t" .
21
+            "<script src=\"{$path}/table.js\" defer></script>\n\t" .
22 22
             "<link href=\"{$path}/table.css\" rel=\"stylesheet\">\n";
23 23
     }
24 24
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             if ($value === true || (empty($value) && $value != 0)) {
33 33
                 $list[] = $key;
34 34
             } else {
35
-                $list[] = $key.'="'.$value.'"';
35
+                $list[] = $key . '="' . $value . '"';
36 36
             }
37 37
         }
38 38
         return rtrim(implode(' ', $list));
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             self::$cols = [];
60 60
             self::$t['rows'] = null;
61 61
         } else {
62
-            echo 'Existing table-id used in table::create(): '.$items;
62
+            echo 'Existing table-id used in table::create(): ' . $items;
63 63
         }
64 64
     }
65 65
     
@@ -71,23 +71,22 @@  discard block
 block discarded – undo
71 71
         try {
72 72
             $p = explode('.', $property);
73 73
             $name = array_shift($p);
74
-            if(property_exists(__CLASS__, $name)){
75
-                switch(sizeof($p)){
74
+            if (property_exists(__CLASS__, $name)) {
75
+                switch (sizeof($p)) {
76 76
                     case 3: return static::$$name[$p[0]][$p[1]][$p[2]] === $value;
77 77
                     case 2: return static::$$name[$p[0]][$p[1]] === $value;
78 78
                     case 1: return $p[0] === '∞' ? //request is to the last one
79
-                        static::$$name[(sizeof(static::$$name)-1)] === $value : 
80
-                        static::$$name[$p[0]] === $value;
79
+                        static::$$name[(sizeof(static::$$name) - 1)] === $value : static::$$name[$p[0]] === $value;
81 80
                     case 0: return static::$$name === $value;
82 81
                     default: 
83 82
                         $oops = implode($p);
84 83
                         throw new Exception('Missing value (' . $oops . ').');
85 84
                 }
86 85
             } else {
87
-                throw new Exception('Undefined property ('.$name.').');
86
+                throw new Exception('Undefined property (' . $name . ').');
88 87
             }
89 88
         } catch (Exception $e) {
90
-            echo 'Caught exception: ',  $e->getMessage(), "\n";
89
+            echo 'Caught exception: ', $e->getMessage(), "\n";
91 90
         }
92 91
         return false;
93 92
     }
Please login to merge, or discard this patch.