Passed
Push — main ( 197711...a7baa5 )
by Sammy
07:12 queued 14s
created
src/HasOne.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         $extraction_table = $extraction_class::table();
14 14
 
15 15
         foreach ($extraction_table->columns() as $column_name => $column) {
16
-            $probe_name = $extraction_class::tableAlias() . '_' . $column_name;
16
+            $probe_name = $extraction_class::tableAlias().'_'.$column_name;
17 17
 
18 18
             if (!is_null($probe_res = $from_model->get($probe_name))) {
19 19
                 $extract_model->set($column_name, $probe_res);
Please login to merge, or discard this patch.
src/TableModelSelector.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
     public function __construct(string $class)
15 15
     {
16
-        if(class_exists($class) === false)
16
+        if (class_exists($class) === false)
17 17
             throw new \Exception('CLASS_NOT_FOUND');
18 18
         
19 19
         $this->class = $class;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@
 block discarded – undo
13 13
 
14 14
     public function __construct(string $class)
15 15
     {
16
-        if(class_exists($class) === false)
17
-            throw new \Exception('CLASS_NOT_FOUND');
16
+        if(class_exists($class) === false) {
17
+                    throw new \Exception('CLASS_NOT_FOUND');
18
+        }
18 19
         
19 20
         $this->class = $class;
20 21
         $this->table = $this->class::table();
Please login to merge, or discard this patch.
src/TightModelSelector.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@
 block discarded – undo
51 51
         }
52 52
         
53 53
         if (isset($options['limit'])) {
54
-            if(is_array($options['limit'])){
54
+            if (is_array($options['limit'])) {
55 55
                 $this->statement()->limit($options['limit'][0], $options['limit'][1]);
56 56
             }
57
-            elseif(is_numeric($options['limit'])){
57
+            elseif (is_numeric($options['limit'])) {
58 58
                 $this->statement()->limit($options['limit']);
59 59
             }
60 60
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
         if (isset($options['limit'])) {
54 54
             if(is_array($options['limit'])){
55 55
                 $this->statement()->limit($options['limit'][0], $options['limit'][1]);
56
-            }
57
-            elseif(is_numeric($options['limit'])){
56
+            } elseif(is_numeric($options['limit'])){
58 57
                 $this->statement()->limit($options['limit']);
59 58
             }
60 59
         }
Please login to merge, or discard this patch.
src/TightModel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     
13 13
     public function __toString()
14 14
     {
15
-        return static::class_short_name() . ' #' . $this->id();
15
+        return static::class_short_name().' #'.$this->id();
16 16
     }
17 17
 
18 18
     public function nid(): string
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function urn(): string
24 24
     {
25
-        return $this->nid() . ':' . $this->id();
25
+        return $this->nid().':'.$this->id();
26 26
     }
27 27
     
28 28
     public function immortal(): bool
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      */
161 161
     public static function tableAlias(): string
162 162
     {
163
-        if (defined(get_called_class() . '::TABLE_ALIAS')) {
163
+        if (defined(get_called_class().'::TABLE_ALIAS')) {
164 164
             return get_called_class()::TABLE_ALIAS;
165 165
         }
166 166
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
     public static function model_type(): string
171 171
     {
172
-        if (defined(get_called_class() . '::MODEL_TYPE')) {
172
+        if (defined(get_called_class().'::MODEL_TYPE')) {
173 173
             return get_called_class()::MODEL_TYPE;
174 174
         }
175 175
 
Please login to merge, or discard this patch.
src/TableModel.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     public function import($assoc_data): self
65 65
     {
66 66
         if (!is_array($assoc_data)) {
67
-            throw new \Exception(__FUNCTION__ . '(assoc_data) parm is not an array');
67
+            throw new \Exception(__FUNCTION__.'(assoc_data) parm is not an array');
68 68
         }
69 69
 
70 70
         // shove it all up in model, god will sort them out
@@ -87,17 +87,17 @@  discard block
 block discarded – undo
87 87
 
88 88
         if ($table_name === false) {
89 89
             $shortName = $reflectionClass->getShortName();
90
-            $table_name = defined($const_name = 'TABLE_' . strtoupper($shortName)) ? constant($const_name) : strtolower($shortName);
90
+            $table_name = defined($const_name = 'TABLE_'.strtoupper($shortName)) ? constant($const_name) : strtolower($shortName);
91 91
         }
92 92
 
93 93
         return $table_name;
94 94
         $table_name = $called_class->getConstant('TABLE_NAME');
95
-        if($table_name !== false)
95
+        if ($table_name !== false)
96 96
             return $table_name;
97 97
 
98 98
         $class_name = $called_class->getShortName();
99 99
         
100
-        if (defined($const_name = 'TABLE_' . strtoupper($class_name)))
100
+        if (defined($const_name = 'TABLE_'.strtoupper($class_name)))
101 101
             return constant($const_name);
102 102
         
103 103
         return strtolower($class_name);
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
 
112 112
         $model_data = get_object_vars($this);
113 113
 
114
-        if($this->isNew()){
114
+        if ($this->isNew()) {
115 115
             // $table_row = new Row($this, $model_data);
116 116
             $table_row = new Row($this->schema, static::table(), $model_data);
117 117
         }
118
-        else{
118
+        else {
119 119
             $table_row = new Row($this->schema);
120 120
             $table_row->load($model_data);
121 121
         }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $table = get_called_class()::table();
162 162
 
163 163
         // case 3
164
-        if(is_array($arg1) && !empty($arg1))
164
+        if (is_array($arg1) && !empty($arg1))
165 165
         {
166 166
             $unique_identifiers = $arg1;
167 167
         }
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         }
245 245
     }
246 246
 
247
-    public static function any($field_exact_values=[], $options = [])
247
+    public static function any($field_exact_values = [], $options = [])
248 248
     {
249 249
         $select = static::filter($field_exact_values, $options);
250 250
         return static::retrieve($select);
Please login to merge, or discard this patch.
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -92,13 +92,15 @@  discard block
 block discarded – undo
92 92
 
93 93
         return $table_name;
94 94
         $table_name = $called_class->getConstant('TABLE_NAME');
95
-        if($table_name !== false)
96
-            return $table_name;
95
+        if($table_name !== false) {
96
+                    return $table_name;
97
+        }
97 98
 
98 99
         $class_name = $called_class->getShortName();
99 100
         
100
-        if (defined($const_name = 'TABLE_' . strtoupper($class_name)))
101
-            return constant($const_name);
101
+        if (defined($const_name = 'TABLE_' . strtoupper($class_name))) {
102
+                    return constant($const_name);
103
+        }
102 104
         
103 105
         return strtolower($class_name);
104 106
     }
@@ -114,8 +116,7 @@  discard block
 block discarded – undo
114 116
         if($this->isNew()){
115 117
             // $table_row = new Row($this, $model_data);
116 118
             $table_row = new Row($this->schema, static::table(), $model_data);
117
-        }
118
-        else{
119
+        } else{
119 120
             $table_row = new Row($this->schema);
120 121
             $table_row->load($model_data);
121 122
         }
@@ -177,9 +178,9 @@  discard block
 block discarded – undo
177 178
         {   
178 179
             $pk = current($table->primaryKeys())->name();
179 180
             $unique_identifiers = [$pk => $arg1];
180
-        } 
181
-        else
182
-            throw new CruditesException('ARGUMENTS_ARE_NOT_ACTIONNABLE');
181
+        } else {
182
+                    throw new CruditesException('ARGUMENTS_ARE_NOT_ACTIONNABLE');
183
+        }
183 184
 
184 185
 
185 186
         // Find the unique identifier(s) in the database.
@@ -238,8 +239,7 @@  discard block
 block discarded – undo
238 239
     {
239 240
         try {
240 241
             return self::one($arg1, $arg2);
241
-        } 
242
-        catch (CruditesException $e) {
242
+        } catch (CruditesException $e) {
243 243
             return null;
244 244
         }
245 245
     }
Please login to merge, or discard this patch.