@@ -35,7 +35,7 @@ |
||
35 | 35 | /** |
36 | 36 | * @param QueryBuilder $builder |
37 | 37 | * @param CriterionInterface|WhereGroup $group |
38 | - * @return iterable|null |
|
38 | + * @return \Generator |
|
39 | 39 | */ |
40 | 40 | public function apply($builder, CriterionInterface $group): ?iterable |
41 | 41 | { |
@@ -27,7 +27,7 @@ |
||
27 | 27 | /** |
28 | 28 | * @param QueryBuilder $builder |
29 | 29 | * @param CriterionInterface|Join $join |
30 | - * @return iterable|null |
|
30 | + * @return \Generator |
|
31 | 31 | */ |
32 | 32 | public function apply($builder, CriterionInterface $join): ?iterable |
33 | 33 | { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ? $this->getAlias($relation) |
63 | 63 | : $this->getCachedAlias($relation); |
64 | 64 | |
65 | - if (! $exists) { |
|
65 | + if (!$exists) { |
|
66 | 66 | // Create join |
67 | 67 | $relationField = Field::new($relation['fieldName'])->toString($alias); |
68 | 68 | $this->join($builder, $join, $relationField, $relationAlias); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | private function getKey(array $relation): string |
110 | 110 | { |
111 | - return $relation['sourceEntity'] . '_' . $relation['targetEntity']; |
|
111 | + return $relation['sourceEntity'].'_'.$relation['targetEntity']; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | { |
131 | 131 | $key = $this->getKey($relation); |
132 | 132 | |
133 | - if (! isset($this->relations[$key])) { |
|
133 | + if (!isset($this->relations[$key])) { |
|
134 | 134 | return $this->relations[$key] = |
135 | 135 | $this->query->createAlias( |
136 | 136 | $relation['sourceEntity'], |
@@ -21,7 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * @param QueryBuilder $builder |
23 | 23 | * @param CriterionInterface|OrderBy $orderBy |
24 | - * @return iterable|null |
|
24 | + * @return \Generator |
|
25 | 25 | */ |
26 | 26 | public function apply($builder, CriterionInterface $orderBy): ?iterable |
27 | 27 | { |
@@ -21,7 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * @param QueryBuilder $builder |
23 | 23 | * @param CriterionInterface|Selection $select |
24 | - * @return iterable|null |
|
24 | + * @return \Generator |
|
25 | 25 | */ |
26 | 26 | public function apply($builder, CriterionInterface $select): ?iterable |
27 | 27 | { |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $selection = yield $select->getField(); |
30 | 30 | |
31 | 31 | if ($select->hasAlias()) { |
32 | - $selection .= ' AS ' . $select->getAlias(); |
|
32 | + $selection .= ' AS '.$select->getAlias(); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $builder->addSelect($selection); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @param QueryBuilder $builder |
26 | 26 | * @param CriterionInterface|Where $where |
27 | - * @return iterable|null |
|
27 | + * @return \Generator |
|
28 | 28 | */ |
29 | 29 | public function apply($builder, CriterionInterface $where): ?iterable |
30 | 30 | { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | - * @param mixed $context |
|
83 | + * @param \Doctrine\ORM\QueryBuilder $context |
|
84 | 84 | * @param Query $query |
85 | 85 | * @return \Generator |
86 | 86 | */ |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | /** |
120 | 120 | * @param Query $query |
121 | - * @return \Generator|BuilderInterface[] |
|
121 | + * @return \Generator |
|
122 | 122 | */ |
123 | 123 | private function builders(Query $query): \Generator |
124 | 124 | { |
@@ -44,6 +44,7 @@ |
||
44 | 44 | |
45 | 45 | /** |
46 | 46 | * @param string ...$patterns |
47 | + * @param string[] $patterns |
|
47 | 48 | * @return string |
48 | 49 | */ |
49 | 50 | public function createAlias(string ...$patterns): string |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | - return 'q' . Str::random(7) . '_' . ++static::$lastQueryId; |
|
63 | + return 'q'.Str::random(7).'_'.++static::$lastQueryId; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function createPlaceholder(string $pattern = null): string |
71 | 71 | { |
72 | - return ':' . $this->createAlias($pattern); |
|
72 | + return ':'.$this->createAlias($pattern); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -10,7 +10,6 @@ |
||
10 | 10 | namespace RDS\Hydrogen\Query; |
11 | 11 | |
12 | 12 | use RDS\Hydrogen\Criteria\HavingGroup; |
13 | -use RDS\Hydrogen\Criteria\WhereGroup; |
|
14 | 13 | use RDS\Hydrogen\Criteria\GroupBy; |
15 | 14 | use RDS\Hydrogen\Criteria\Having; |
16 | 15 | use RDS\Hydrogen\Query; |
@@ -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 |