@@ -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 = []; |
@@ -73,8 +72,7 @@ discard block |
||
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 |
||
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 |
||
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); |