@@ -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(); |
@@ -70,8 +70,7 @@ |
||
| 70 | 70 | public function is ($arg): string { |
| 71 | 71 | if ($arg === null or is_bool($arg)) { |
| 72 | 72 | $arg = ['' => 'NULL', 1 => 'TRUE', 0 => 'FALSE'][$arg]; |
| 73 | - } |
|
| 74 | - else { |
|
| 73 | + } else { |
|
| 75 | 74 | $arg = $this->db->quote($arg); |
| 76 | 75 | } |
| 77 | 76 | $operator = ['mysql' => '<=>', 'sqlite' => 'IS'][$this->db->getDriver()]; |
@@ -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); |
@@ -86,11 +86,9 @@ discard block |
||
| 86 | 86 | $cmp[$k] = static::compare($k, $operator, $v, $subOperator, $listOperator); |
| 87 | 87 | } |
| 88 | 88 | return $cmp; |
| 89 | - } |
|
| 90 | - elseif (is_array($b)) { |
|
| 89 | + } elseif (is_array($b)) { |
|
| 91 | 90 | return "{$a} {$listOperator} (" . implode(',', $b) . ")"; |
| 92 | - } |
|
| 93 | - elseif ($b instanceof Select) { |
|
| 91 | + } elseif ($b instanceof Select) { |
|
| 94 | 92 | return "{$a} {$operator} {$subOperator} ({$b->toSql()})"; |
| 95 | 93 | } |
| 96 | 94 | return "{$a} {$operator} {$b}"; |
@@ -359,8 +357,7 @@ discard block |
||
| 359 | 357 | foreach ($columns as $alias => $name) { |
| 360 | 358 | if (is_string($alias) and $alias !== $name) { |
| 361 | 359 | $names[] = $name . ' AS ' . $alias; |
| 362 | - } |
|
| 363 | - else { |
|
| 360 | + } else { |
|
| 364 | 361 | $names[] = $name; |
| 365 | 362 | } |
| 366 | 363 | } |