@@ -63,12 +63,10 @@ |
||
| 63 | 63 | if (isset($value)) { |
| 64 | 64 | assert(is_scalar($value)); |
| 65 | 65 | $this->attributes[$attr] = $value; |
| 66 | - } |
|
| 67 | - else { |
|
| 66 | + } else { |
|
| 68 | 67 | $this->offsetUnset($attr); |
| 69 | 68 | } |
| 70 | - } |
|
| 71 | - else { |
|
| 69 | + } else { |
|
| 72 | 70 | // appending must not be null. |
| 73 | 71 | // even though missing numeric offsets would yield null when fetched individually, |
| 74 | 72 | // getAttributes() would not have them. |
@@ -147,8 +147,7 @@ discard block |
||
| 147 | 147 | $doc = $rProp->getDocComment(); |
| 148 | 148 | if (preg_match(static::RX_IS_COLUMN, $doc)) { |
| 149 | 149 | $columns[] = $rProp->getName(); |
| 150 | - } |
|
| 151 | - elseif (preg_match(static::RX_EAV, $doc, $eav)) { |
|
| 150 | + } elseif (preg_match(static::RX_EAV, $doc, $eav)) { |
|
| 152 | 151 | preg_match(static::RX_EAV_VAR, $doc, $var); |
| 153 | 152 | $type = $var['type'] ?? 'string'; |
| 154 | 153 | $type = static::SCALARS[$type] ?? 'string'; |
@@ -513,8 +512,7 @@ discard block |
||
| 513 | 512 | public function save (EntityInterface $entity): int { |
| 514 | 513 | if (!$entity->getId()) { |
| 515 | 514 | $this->saveInsert($entity); |
| 516 | - } |
|
| 517 | - else { |
|
| 515 | + } else { |
|
| 518 | 516 | $this->saveUpdate($entity); |
| 519 | 517 | } |
| 520 | 518 | $this->saveEav($entity); |
@@ -637,8 +635,7 @@ discard block |
||
| 637 | 635 | foreach ($values as $name => $value) { |
| 638 | 636 | if (isset($this->properties[$name])) { |
| 639 | 637 | $this->properties[$name]->setValue($entity, $this->setType($name, $value)); |
| 640 | - } |
|
| 641 | - else { |
|
| 638 | + } else { |
|
| 642 | 639 | // attempt to set unknown fields directly on the instance. |
| 643 | 640 | $entity->{$name} = $value; |
| 644 | 641 | } |