@@ -62,8 +62,7 @@ discard block |
||
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 = []; |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | $name = $rProp->getName(); |
75 | 74 | if (preg_match('/@col(umn)?[\s$]/', $doc)) { |
76 | 75 | $columns[] = $name; |
77 | - } |
|
78 | - elseif (preg_match('/@eav\s+(?<table>\S+)/', $doc, $attr)) { |
|
76 | + } elseif (preg_match('/@eav\s+(?<table>\S+)/', $doc, $attr)) { |
|
79 | 77 | $eav[$name] = $db->factory(EAV::class, $db, $attr['table']); |
80 | 78 | } |
81 | 79 | } |
@@ -114,8 +112,7 @@ discard block |
||
114 | 112 | $rProp->setAccessible(true); |
115 | 113 | $this->properties[$name] = $rProp; |
116 | 114 | } |
117 | - } |
|
118 | - catch (ReflectionException $exception) { |
|
115 | + } catch (ReflectionException $exception) { |
|
119 | 116 | throw new LogicException('Unexpected ReflectionException', 0, $exception); |
120 | 117 | } |
121 | 118 | } |
@@ -242,8 +239,7 @@ discard block |
||
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); |