Passed
Push — master ( ec8004...0edb33 )
by y
02:18
created
src/DB/Record.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -126,8 +126,7 @@  discard block
 block discarded – undo
126 126
             $doc = $rProp->getDocComment();
127 127
             if (preg_match(static::RX_IS_COLUMN, $doc)) {
128 128
                 $columns[] = $rProp->getName();
129
-            }
130
-            elseif (preg_match(static::RX_EAV, $doc, $eav)) {
129
+            } elseif (preg_match(static::RX_EAV, $doc, $eav)) {
131 130
                 preg_match(static::RX_EAV_VAR, $doc, $var);
132 131
                 $EAV[$rProp->getName()] = EAV::factory($db, $eav['table'], $var['type'] ?? 'string');
133 132
             }
@@ -160,8 +159,7 @@  discard block
 block discarded – undo
160 159
             if ($rType = $rProp->getType() and $rType instanceof ReflectionNamedType) {
161 160
                 if (preg_match(static::RX_IS_SCALAR, $rType->getName())) {
162 161
                     $type = $rType->getName();
163
-                }
164
-                else { // "array", "object", class name
162
+                } else { // "array", "object", class name
165 163
                     $type = self::DEHYDRATE_AS[$rType->getName()];
166 164
                     $this->hydration[$prop] = $rType->getName();
167 165
                 }
@@ -181,8 +179,7 @@  discard block
 block discarded – undo
181 179
                 if (isset($defaults[$prop])) {
182 180
                     $type = gettype($defaults[$prop]);
183 181
                     $nullable = false;
184
-                }
185
-                else {
182
+                } else {
186 183
                     $type = 'string';
187 184
                     $nullable = true;
188 185
                 }
@@ -417,8 +414,7 @@  discard block
 block discarded – undo
417 414
     public function save (EntityInterface $entity): int {
418 415
         if (!$entity->getId()) {
419 416
             $this->saveInsert($entity);
420
-        }
421
-        else {
417
+        } else {
422 418
             $this->saveUpdate($entity);
423 419
         }
424 420
         $this->saveEav($entity);
@@ -541,8 +537,7 @@  discard block
 block discarded – undo
541 537
         foreach ($values as $name => $value) {
542 538
             if (isset($this->properties[$name])) {
543 539
                 $this->properties[$name]->setValue($entity, $this->setType($name, $value));
544
-            }
545
-            else {
540
+            } else {
546 541
                 // attempt to set unknown fields directly on the instance.
547 542
                 $entity->{$name} = $value;
548 543
             }
Please login to merge, or discard this patch.