@@ -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); |
@@ -272,8 +272,7 @@ |
||
| 272 | 272 | foreach ($this->columns as $alias => $name) { |
| 273 | 273 | if (is_string($alias) and $name !== $alias) { |
| 274 | 274 | $columns[] = "{$name} AS {$alias}"; |
| 275 | - } |
|
| 276 | - else { |
|
| 275 | + } else { |
|
| 277 | 276 | $columns[] = $name; |
| 278 | 277 | } |
| 279 | 278 | } |
@@ -60,8 +60,7 @@ |
||
| 60 | 60 | public static function compare ($a, $b = null, $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}"); |
@@ -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()]; |