@@ -35,8 +35,7 @@ |
||
35 | 35 | $this->interface = $interface; |
36 | 36 | try { |
37 | 37 | $interface = new ReflectionClass($interface); |
38 | - } |
|
39 | - catch (ReflectionException $exception) { |
|
38 | + } catch (ReflectionException $exception) { |
|
40 | 39 | throw new LogicException('Unexpected ReflectionException', 0, $exception); |
41 | 40 | } |
42 | 41 | $doc = $interface->getDocComment(); |
@@ -66,8 +66,7 @@ discard block |
||
66 | 66 | $this->class = $class; |
67 | 67 | try { |
68 | 68 | $class = new ReflectionClass($class); |
69 | - } |
|
70 | - catch (ReflectionException $exception) { |
|
69 | + } catch (ReflectionException $exception) { |
|
71 | 70 | throw new LogicException('Unexpected ReflectionException', 0, $exception); |
72 | 71 | } |
73 | 72 | $this->proto = $class->newInstanceWithoutConstructor(); |
@@ -84,8 +83,7 @@ discard block |
||
84 | 83 | if (preg_match('/@var\s+(?<type>[a-z]+)[\s$]/', $doc, $match)) { |
85 | 84 | $types[$name] = $match['type']; |
86 | 85 | } |
87 | - } |
|
88 | - elseif (preg_match('/@eav\s+(?<table>\S+)/', $doc, $match)) { |
|
86 | + } elseif (preg_match('/@eav\s+(?<table>\S+)/', $doc, $match)) { |
|
89 | 87 | $eav[$name] = $match['table']; |
90 | 88 | $this->properties[$name] = $property; |
91 | 89 | } |
@@ -213,8 +211,7 @@ discard block |
||
213 | 211 | public function save (EntityInterface $entity): int { |
214 | 212 | if (!$entity->getId()) { |
215 | 213 | $this->saveInsert($entity); |
216 | - } |
|
217 | - else { |
|
214 | + } else { |
|
218 | 215 | $this->saveUpdate($entity); |
219 | 216 | } |
220 | 217 | $this->saveEav($entity); |
@@ -29,8 +29,7 @@ |
||
29 | 29 | public function is ($arg): Predicate { |
30 | 30 | if ($arg === null or is_bool($arg)) { |
31 | 31 | $arg = ['' => 'NULL', 1 => 'TRUE', 0 => 'FALSE'][$arg]; |
32 | - } |
|
33 | - else { |
|
32 | + } else { |
|
34 | 33 | $arg = $this->db->quote($arg); |
35 | 34 | } |
36 | 35 | $oper = ['mysql' => '<=>', 'sqlite' => 'IS'][$this->db->getDriver()]; |
@@ -60,8 +60,7 @@ |
||
60 | 60 | public static function compare ($a, $b, $oper = '=', $subOper = 'ANY', $listOper = 'IN') { |
61 | 61 | if (is_array($b)) { |
62 | 62 | return new static("{$a} {$listOper} (" . implode(',', $b) . ")"); |
63 | - } |
|
64 | - elseif ($b instanceof Select) { |
|
63 | + } elseif ($b instanceof Select) { |
|
65 | 64 | return new static("{$a} {$oper} {$subOper} ({$b->toSql()})"); |
66 | 65 | } |
67 | 66 | return new static("{$a} {$oper} {$b}"); |
@@ -173,8 +173,7 @@ discard block |
||
173 | 173 | public function group (string $column) { |
174 | 174 | if (!strlen($this->_group)) { |
175 | 175 | $this->_group = " GROUP BY {$column}"; |
176 | - } |
|
177 | - else { |
|
176 | + } else { |
|
178 | 177 | $this->_group .= ", {$column}"; |
179 | 178 | } |
180 | 179 | return $this; |
@@ -189,8 +188,7 @@ discard block |
||
189 | 188 | public function having (string $condition) { |
190 | 189 | if (!strlen($this->_having)) { |
191 | 190 | $this->_having = " HAVING {$condition}"; |
192 | - } |
|
193 | - else { |
|
191 | + } else { |
|
194 | 192 | $this->_having .= " AND {$condition}"; |
195 | 193 | } |
196 | 194 | return $this; |
@@ -222,8 +220,7 @@ discard block |
||
222 | 220 | public function limit (int $limit, int $offset = 0) { |
223 | 221 | if ($limit == 0) { |
224 | 222 | $this->_limit = ''; |
225 | - } |
|
226 | - else { |
|
223 | + } else { |
|
227 | 224 | $this->_limit = " LIMIT {$limit}"; |
228 | 225 | if ($offset > 1) { |
229 | 226 | $this->_limit .= " OFFSET {$offset}"; |
@@ -314,8 +311,7 @@ discard block |
||
314 | 311 | public function where (string $condition) { |
315 | 312 | if (!strlen($this->_where)) { |
316 | 313 | $this->_where = " WHERE {$condition}"; |
317 | - } |
|
318 | - else { |
|
314 | + } else { |
|
319 | 315 | $this->_where .= " AND {$condition}"; |
320 | 316 | } |
321 | 317 | return $this; |