@@ -30,7 +30,7 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $expression = $this->getDoctrineExpression($where, $builder->expr(), $where->getField()); |
| 32 | 32 | |
| 33 | - yield from $this->extractResult($expression, function ($expr) use ($where, $builder) { |
|
| 33 | + yield from $this->extractResult($expression, function($expr) use ($where, $builder) { |
|
| 34 | 34 | if ($where->isAnd()) { |
| 35 | 35 | $builder->andWhere($expr); |
| 36 | 36 | } else { |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | return \iterator_to_array($value); |
| 63 | 63 | |
| 64 | 64 | case \is_object($value) && \method_exists($value, '__toString'): |
| 65 | - return (string)$value; |
|
| 65 | + return (string) $value; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | return $value; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | $field = null; |
| 103 | 103 | |
| 104 | - $replacement = function (array $matches) use (&$field) { |
|
| 104 | + $replacement = function(array $matches) use (&$field) { |
|
| 105 | 105 | $field = $matches[1] ?: ($matches[2] ?? null); |
| 106 | 106 | |
| 107 | 107 | return \str_replace_first($field, '%s', $matches[0]); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | throw new \LogicException($error); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - return \array_merge([$wrapper], $this->analyzePrefix((string)$field)); |
|
| 117 | + return \array_merge([$wrapper], $this->analyzePrefix((string) $field)); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | ($this->then)($query); |
| 70 | 70 | |
| 71 | 71 | foreach ($query->getCriteria() as $criterion) { |
| 72 | - if (! $criterion instanceof Where) { |
|
| 72 | + if (!$criterion instanceof Where) { |
|
| 73 | 73 | $error = 'Groups allow to specify only Where selections, but %s given'; |
| 74 | 74 | throw new \LogicException(\sprintf($error, $criterion)); |
| 75 | 75 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $error = 'Relation should be string ("relation_name") '. |
| 43 | - 'or array (["relation" => function]), ' . |
|
| 43 | + 'or array (["relation" => function]), '. |
|
| 44 | 44 | 'but %s given'; |
| 45 | 45 | |
| 46 | 46 | throw new \InvalidArgumentException(\sprintf($error, \gettype($relation))); |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | */ |
| 111 | 111 | protected function mode(): bool |
| 112 | 112 | { |
| 113 | - return \tap($this->conjunction, function () { |
|
| 113 | + return \tap($this->conjunction, function() { |
|
| 114 | 114 | $this->conjunction = true; |
| 115 | 115 | }); |
| 116 | 116 | } |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | namespace RDS\Hydrogen\Query; |
| 11 | 11 | |
| 12 | 12 | use RDS\Hydrogen\Criteria\Group; |
| 13 | -use RDS\Hydrogen\Criteria\Having; |
|
| 14 | 13 | use RDS\Hydrogen\Criteria\Where; |
| 15 | 14 | use RDS\Hydrogen\Query; |
| 16 | 15 | use RDS\Hydrogen\Query\WhereProvider\WhereBetweenProvider; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | { |
| 51 | 51 | $name = $pattern |
| 52 | 52 | ? \snake_case(\class_basename($pattern)) |
| 53 | - : 'q' . Str::random(7); |
|
| 53 | + : 'q'.Str::random(7); |
|
| 54 | 54 | |
| 55 | 55 | return \sprintf('%s_%d', $name, ++static::$lastQueryId); |
| 56 | 56 | } |
@@ -61,6 +61,6 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function placeholder(string $pattern = null): string |
| 63 | 63 | { |
| 64 | - return ':' . $this->createAlias($pattern); |
|
| 64 | + return ':'.$this->createAlias($pattern); |
|
| 65 | 65 | } |
| 66 | 66 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function select(...$fields): self |
| 26 | 26 | { |
| 27 | 27 | foreach ($fields as $field) { |
| 28 | - if (! \is_array($field) && ! \is_string($field)) { |
|
| 28 | + if (!\is_array($field) && !\is_string($field)) { |
|
| 29 | 29 | $error = 'Selection should be array (["field" => "alias"]) or string ("field") but %s given'; |
| 30 | 30 | throw new \InvalidArgumentException(\sprintf($error, \gettype($field))); |
| 31 | 31 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function query(): Query |
| 44 | 44 | { |
| 45 | - if (! $this instanceof EntityRepository) { |
|
| 45 | + if (!$this instanceof EntityRepository) { |
|
| 46 | 46 | $error = 'Could not use %s under non-repository class, but %s given'; |
| 47 | 47 | throw new \LogicException(\sprintf($error, Hydrogen::class, static::class)); |
| 48 | 48 | } |