Passed
Push — master ( c55c4a...28db53 )
by y
01:27
created
src/DB/Junction.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@
 block discarded – undo
31 31
     public static function fromInterface (DB $db, string $interface) {
32 32
         try {
33 33
             $ref = new ReflectionClass($interface);
34
-        }
35
-        catch (ReflectionException $exception) {
34
+        } catch (ReflectionException $exception) {
36 35
             throw new LogicException('Unexpected ReflectionException', 0, $exception);
37 36
         }
38 37
         $doc = $ref->getDocComment();
Please login to merge, or discard this patch.
src/DB/Record.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@  discard block
 block discarded – undo
62 62
     public static function fromClass (DB $db, $class) {
63 63
         try {
64 64
             $rClass = new ReflectionClass($class);
65
-        }
66
-        catch (ReflectionException $exception) {
65
+        } catch (ReflectionException $exception) {
67 66
             throw new LogicException('Unexpected ReflectionException', 0, $exception);
68 67
         }
69 68
         $columns = [];
@@ -73,8 +72,7 @@  discard block
 block discarded – undo
73 72
             $name = $rProp->getName();
74 73
             if (preg_match('/@col(umn)?[\s$]/', $doc)) {
75 74
                 $columns[] = $name;
76
-            }
77
-            elseif (preg_match('/@eav\s+(?<table>\S+)/', $doc, $attr)) {
75
+            } elseif (preg_match('/@eav\s+(?<table>\S+)/', $doc, $attr)) {
78 76
                 $eav[$name] = new EAV($db, $attr['table']);
79 77
             }
80 78
         }
@@ -113,8 +111,7 @@  discard block
 block discarded – undo
113 111
                 $rProp->setAccessible(true);
114 112
                 $this->properties[$name] = $rProp;
115 113
             }
116
-        }
117
-        catch (ReflectionException $exception) {
114
+        } catch (ReflectionException $exception) {
118 115
             throw new LogicException('Unexpected ReflectionException', 0, $exception);
119 116
         }
120 117
     }
@@ -242,8 +239,7 @@  discard block
 block discarded – undo
242 239
     public function save (EntityInterface $entity): int {
243 240
         if (!$entity->getId()) {
244 241
             $this->saveInsert($entity);
245
-        }
246
-        else {
242
+        } else {
247 243
             $this->saveUpdate($entity);
248 244
         }
249 245
         $this->saveEav($entity);
Please login to merge, or discard this patch.
src/DB.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -196,8 +196,7 @@
 block discarded – undo
196 196
     public function offsetSet ($class, $access) {
197 197
         if ($access instanceof Record) {
198 198
             $this->setRecord($class, $access);
199
-        }
200
-        else {
199
+        } else {
201 200
             $this->setJunction($class, $access);
202 201
         }
203 202
     }
Please login to merge, or discard this patch.
src/DB/Select.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -108,8 +108,7 @@  discard block
 block discarded – undo
108 108
         if ($table instanceof Select) {
109 109
             $this->table = $table->toSubquery();
110 110
             $this->alias = uniqid('_') . "_{$table->alias}";
111
-        }
112
-        else {
111
+        } else {
113 112
             $this->table = (string)$table;
114 113
             $this->alias = uniqid('_') . "__{$table}";
115 114
         }
@@ -219,8 +218,7 @@  discard block
 block discarded – undo
219 218
     public function group (string $column) {
220 219
         if (!strlen($this->_group)) {
221 220
             $this->_group = " GROUP BY {$column}";
222
-        }
223
-        else {
221
+        } else {
224 222
             $this->_group .= ", {$column}";
225 223
         }
226 224
         return $this;
@@ -235,8 +233,7 @@  discard block
 block discarded – undo
235 233
     public function having (string $condition) {
236 234
         if (!strlen($this->_having)) {
237 235
             $this->_having = " HAVING {$condition}";
238
-        }
239
-        else {
236
+        } else {
240 237
             $this->_having .= " AND {$condition}";
241 238
         }
242 239
         return $this;
@@ -286,8 +283,7 @@  discard block
 block discarded – undo
286 283
     public function limit (int $limit, int $offset = 0) {
287 284
         if ($limit == 0) {
288 285
             $this->_limit = '';
289
-        }
290
-        else {
286
+        } else {
291 287
             $this->_limit = " LIMIT {$limit}";
292 288
             if ($offset > 1) {
293 289
                 $this->_limit .= " OFFSET {$offset}";
@@ -366,8 +362,7 @@  discard block
 block discarded – undo
366 362
             }
367 363
             if ($name === $alias) {
368 364
                 $_columns[] = "{$column}";
369
-            }
370
-            else {
365
+            } else {
371 366
                 $_columns[] = "{$column} AS {$alias}";
372 367
             }
373 368
             $i++;
@@ -419,8 +414,7 @@  discard block
 block discarded – undo
419 414
     public function where (string $condition) {
420 415
         if (!strlen($this->_where)) {
421 416
             $this->_where = " WHERE {$condition}";
422
-        }
423
-        else {
417
+        } else {
424 418
             $this->_where .= " AND {$condition}";
425 419
         }
426 420
         return $this;
Please login to merge, or discard this patch.
src/DB/SQL/ComparisonTrait.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,7 @@
 block discarded – undo
66 66
         }
67 67
         if ($arg === null or is_bool($arg)) {
68 68
             $arg = ['' => 'NULL', 1 => 'TRUE', 0 => 'FALSE'][$arg];
69
-        }
70
-        else {
69
+        } else {
71 70
             $arg = $this->db->quote($arg);
72 71
         }
73 72
         $oper = ['mysql' => '<=>', 'sqlite' => 'IS'][$driver];
Please login to merge, or discard this patch.