@@ -337,6 +337,7 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | /** |
| 339 | 339 | * @param string ...$fields |
| 340 | + * @param string[] $fields |
|
| 340 | 341 | * @return Query|$this|self |
| 341 | 342 | */ |
| 342 | 343 | public function asc(string ...$fields): self |
@@ -370,6 +371,7 @@ discard block |
||
| 370 | 371 | |
| 371 | 372 | /** |
| 372 | 373 | * @param string ...$fields |
| 374 | + * @param string[] $fields |
|
| 373 | 375 | * @return Query|$this|self |
| 374 | 376 | */ |
| 375 | 377 | public function desc(string ...$fields): self |
@@ -531,7 +533,7 @@ discard block |
||
| 531 | 533 | } |
| 532 | 534 | |
| 533 | 535 | /** |
| 534 | - * @return \Traversable|CriterionInterface[] |
|
| 536 | + * @return \Generator |
|
| 535 | 537 | */ |
| 536 | 538 | public function getCriteria(): iterable |
| 537 | 539 | { |
@@ -549,7 +551,7 @@ discard block |
||
| 549 | 551 | } |
| 550 | 552 | |
| 551 | 553 | /** |
| 552 | - * @param Selectable[] $contexts |
|
| 554 | + * @param ObjectRepository $contexts |
|
| 553 | 555 | * @return Query|$this|self |
| 554 | 556 | */ |
| 555 | 557 | public function scope(Selectable ...$contexts): self |
@@ -587,7 +589,7 @@ discard block |
||
| 587 | 589 | } |
| 588 | 590 | |
| 589 | 591 | /** |
| 590 | - * @return \Traversable|Selectable[] |
|
| 592 | + * @return \Generator |
|
| 591 | 593 | */ |
| 592 | 594 | public function getScopes(): \Traversable |
| 593 | 595 | { |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | private function mode(): bool |
| 134 | 134 | { |
| 135 | - return \tap($this->conjunction, function () { |
|
| 135 | + return \tap($this->conjunction, function() { |
|
| 136 | 136 | $this->conjunction = true; |
| 137 | 137 | }); |
| 138 | 138 | } |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | $scopes = \implode(', ', \array_map('\\class_basename', $this->scopes)); |
| 637 | 637 | $error = \vsprintf('Can not find method %s in %s%s', [ |
| 638 | 638 | $method, |
| 639 | - $scopes ? $scopes . ' or ' : '', |
|
| 639 | + $scopes ? $scopes.' or ' : '', |
|
| 640 | 640 | \class_basename($this), |
| 641 | 641 | ]); |
| 642 | 642 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | continue; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - throw new \InvalidArgumentException('Inner selection does not support the ' . \class_basename($where)); |
|
| 45 | + throw new \InvalidArgumentException('Inner selection does not support the '.\class_basename($where)); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | return $group->isAnd() |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | final public function __get($key) |
| 42 | 42 | { |
| 43 | - if (! \in_array($key, static::$proxies, true)) { |
|
| 43 | + if (!\in_array($key, static::$proxies, true)) { |
|
| 44 | 44 | $error = \sprintf('Property [%s] does not exist on this collection instance.', $key); |
| 45 | 45 | throw new \InvalidArgumentException($error); |
| 46 | 46 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public function indexOf($element) |
| 219 | 219 | { |
| 220 | - foreach($this->items as $key => $value) { |
|
| 220 | + foreach ($this->items as $key => $value) { |
|
| 221 | 221 | if ($value === $element) { |
| 222 | 222 | return $key; |
| 223 | 223 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * }, ...); |
| 24 | 24 | * </code> |
| 25 | 25 | */ |
| 26 | - if (! \defined('_')) { |
|
| 26 | + if (!\defined('_')) { |
|
| 27 | 27 | \define('_', \RDS\Hydrogen\Collection\HigherOrderCollectionProxy::PATTERN); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -64,6 +64,6 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | public function isDesc(): bool |
| 66 | 66 | { |
| 67 | - return ! $this->asc; |
|
| 67 | + return !$this->asc; |
|
| 68 | 68 | } |
| 69 | 69 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | foreach ($query->getCriteria() as $criterion) { |
| 134 | 134 | $identifier = \get_class($criterion); |
| 135 | 135 | |
| 136 | - if (! \array_key_exists($identifier, $criteria)) { |
|
| 136 | + if (!\array_key_exists($identifier, $criteria)) { |
|
| 137 | 137 | $criteria[$identifier] = $this->criterion($criterion, $alias); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public function count(Query $query): int |
| 214 | 214 | { |
| 215 | - return $this->scalar($query, function (QueryBuilder $builder, string $field) { |
|
| 215 | + return $this->scalar($query, function(QueryBuilder $builder, string $field) { |
|
| 216 | 216 | return $builder->expr()->count($field); |
| 217 | 217 | }); |
| 218 | 218 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $builder = $this->toBuilder($query); |
| 229 | 229 | |
| 230 | 230 | try { |
| 231 | - return (int)$builder->select($expr($builder, $this->getPrimary()->withAlias($this->alias))) |
|
| 231 | + return (int) $builder->select($expr($builder, $this->getPrimary()->withAlias($this->alias))) |
|
| 232 | 232 | ->getQuery() |
| 233 | 233 | ->getSingleScalarResult(); |
| 234 | 234 | } catch (NoResultException | \InvalidArgumentException $e) { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $exists = $this->hasAlias($parent); |
| 43 | 43 | $childAlias = $this->fetchAlias($parent, $relation->getName()); |
| 44 | 44 | |
| 45 | - if (! $exists) { |
|
| 45 | + if (!$exists) { |
|
| 46 | 46 | $builder->leftJoin($parent, $childAlias); |
| 47 | 47 | $builder->addSelect($childAlias); |
| 48 | 48 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | private function fetchAlias(string $parent, string $class): string |
| 73 | 73 | { |
| 74 | - if (! $this->hasAlias($parent)) { |
|
| 74 | + if (!$this->hasAlias($parent)) { |
|
| 75 | 75 | $this->relations[$parent] = $this->createAlias($class); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -84,6 +84,6 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | private function createAlias(string $class): string |
| 86 | 86 | { |
| 87 | - return 'ref_' . \snake_case(\class_basename($class)) . '_' . ++self::$relationId; |
|
| 87 | + return 'ref_'.\snake_case(\class_basename($class)).'_'.++self::$relationId; |
|
| 88 | 88 | } |
| 89 | 89 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | $this->parameters[$alias] = $value; |
| 74 | 74 | |
| 75 | - return ':' . $alias; |
|
| 75 | + return ':'.$alias; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | $prefix = $field ? $field->getName() : 'value'; |
| 87 | 87 | |
| 88 | - return \preg_replace('/\W+/u', '_', $prefix . self::$parameterId++); |
|
| 88 | + return \preg_replace('/\W+/u', '_', $prefix.self::$parameterId++); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -52,6 +52,6 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | private function createAlias(string $class): string |
| 54 | 54 | { |
| 55 | - return 'ref_' . \snake_case(\class_basename($class)) . '_' . ++self::$relationId; |
|
| 55 | + return 'ref_'.\snake_case(\class_basename($class)).'_'.++self::$relationId; |
|
| 56 | 56 | } |
| 57 | 57 | } |