@@ -25,7 +25,7 @@ |
||
25 | 25 | protected $repository; |
26 | 26 | |
27 | 27 | /** |
28 | - * @param ObjectRepository|Hydrogen $repository |
|
28 | + * @param ObjectRepository $repository |
|
29 | 29 | * @return Query|$this |
30 | 30 | */ |
31 | 31 | public function from(ObjectRepository $repository): self |
@@ -10,7 +10,6 @@ |
||
10 | 10 | namespace RDS\Hydrogen\Query\WhereProvider; |
11 | 11 | |
12 | 12 | use RDS\Hydrogen\Criteria\Where\Operator; |
13 | -use RDS\Hydrogen\Criteria\Where; |
|
14 | 13 | use RDS\Hydrogen\Query; |
15 | 14 | |
16 | 15 | /** |
@@ -10,7 +10,6 @@ |
||
10 | 10 | namespace RDS\Hydrogen\Query\WhereProvider; |
11 | 11 | |
12 | 12 | use RDS\Hydrogen\Criteria\Where\Operator; |
13 | -use RDS\Hydrogen\Criteria\Where; |
|
14 | 13 | use RDS\Hydrogen\Query; |
15 | 14 | |
16 | 15 | /** |
@@ -25,7 +25,7 @@ discard block |
||
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 | } |
@@ -52,6 +52,6 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function withEntity(string $alias = null): Query |
54 | 54 | { |
55 | - return $this->select([':' . $this->getAlias() => $alias]); |
|
55 | + return $this->select([':'.$this->getAlias() => $alias]); |
|
56 | 56 | } |
57 | 57 | } |
@@ -25,6 +25,6 @@ |
||
25 | 25 | */ |
26 | 26 | public function apply($builder, CriterionInterface $relation): ?iterable |
27 | 27 | { |
28 | - throw new \LogicException(__CLASS__ . ' not implemented yet'); |
|
28 | + throw new \LogicException(__CLASS__.' not implemented yet'); |
|
29 | 29 | } |
30 | 30 | } |
@@ -58,6 +58,6 @@ |
||
58 | 58 | { |
59 | 59 | $alias = $sqlWalker->getSQLTableAlias($this->table->value, $this->alias->value); |
60 | 60 | |
61 | - return $alias . '.' . $this->field->value; |
|
61 | + return $alias.'.'.$this->field->value; |
|
62 | 62 | } |
63 | 63 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | private function registerDQLFunctions(Configuration $config): void |
45 | 45 | { |
46 | 46 | foreach (self::DQL_FUNCTIONS as $name => $fn) { |
47 | - if (! $config->getCustomStringFunction($name)) { |
|
47 | + if (!$config->getCustomStringFunction($name)) { |
|
48 | 48 | $config->addCustomStringFunction($name, $fn); |
49 | 49 | } |
50 | 50 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | /** |
182 | 182 | * Returns a list of selection criteria. |
183 | 183 | * |
184 | - * @return \Generator|CriterionInterface[] |
|
184 | + * @return \Generator |
|
185 | 185 | */ |
186 | 186 | public function getCriteria(): \Generator |
187 | 187 | { |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
298 | - * @param string|\Closure $filter |
|
298 | + * @param \Closure $filter |
|
299 | 299 | * @return Query |
300 | 300 | */ |
301 | 301 | public function only($filter): Query |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function add(CriterionInterface $criterion): self |
198 | 198 | { |
199 | - if (! $criterion->isAttached()) { |
|
199 | + if (!$criterion->isAttached()) { |
|
200 | 200 | $criterion->attach($this); |
201 | 201 | } |
202 | 202 | |
@@ -302,10 +302,10 @@ discard block |
||
302 | 302 | { |
303 | 303 | \assert(\is_string($filter) || \is_callable($filter)); |
304 | 304 | |
305 | - if (\is_string($filter) && ! \is_callable($filter)) { |
|
305 | + if (\is_string($filter) && !\is_callable($filter)) { |
|
306 | 306 | $typeOf = $filter; |
307 | 307 | |
308 | - $filter = function (CriterionInterface $criterion) use ($typeOf): bool { |
|
308 | + $filter = function(CriterionInterface $criterion) use ($typeOf): bool { |
|
309 | 309 | return $criterion instanceof $typeOf; |
310 | 310 | }; |
311 | 311 | } |
@@ -331,14 +331,14 @@ discard block |
||
331 | 331 | */ |
332 | 332 | public function except($filter): Query |
333 | 333 | { |
334 | - if (\is_string($filter) && ! \is_callable($filter)) { |
|
335 | - return $this->only(function (CriterionInterface $criterion) use ($filter): bool { |
|
336 | - return ! $criterion instanceof $filter; |
|
334 | + if (\is_string($filter) && !\is_callable($filter)) { |
|
335 | + return $this->only(function(CriterionInterface $criterion) use ($filter): bool { |
|
336 | + return !$criterion instanceof $filter; |
|
337 | 337 | }); |
338 | 338 | } |
339 | 339 | |
340 | - return $this->only(function (CriterionInterface $criterion) use ($filter): bool { |
|
341 | - return ! $filter($criterion); |
|
340 | + return $this->only(function(CriterionInterface $criterion) use ($filter): bool { |
|
341 | + return !$filter($criterion); |
|
342 | 342 | }); |
343 | 343 | } |
344 | 344 |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ? \get_class(\array_last($this->criteria)) |
74 | 74 | : null; |
75 | 75 | |
76 | - switch($latest) { |
|
76 | + switch ($latest) { |
|
77 | 77 | case Where::class: |
78 | 78 | case WhereGroup::class: |
79 | 79 | return new WhereGroup($this, $group, $this->mode()); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | protected function mode(): bool |
96 | 96 | { |
97 | - return \tap($this->conjunction, function (): void { |
|
97 | + return \tap($this->conjunction, function(): void { |
|
98 | 98 | $this->conjunction = true; |
99 | 99 | }); |
100 | 100 | } |