@@ -25,12 +25,12 @@ |
||
25 | 25 | |
26 | 26 | if ($this->maxRunningTime != 0 && $time > $this->maxRunningTime) { |
27 | 27 | $this->fail( |
28 | - sprintf( |
|
28 | + sprintf( |
|
29 | 29 | 'expected running time: <= %s but was: %s', |
30 | 30 | |
31 | 31 | $this->maxRunningTime, |
32 | 32 | $time |
33 | - ) |
|
33 | + ) |
|
34 | 34 | ); |
35 | 35 | } |
36 | 36 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests; |
6 | 6 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function setMaxRunningTime($maxRunningTime) |
50 | 50 | { |
51 | - if (! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
51 | + if ( ! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
52 | 52 | throw new \InvalidArgumentException; |
53 | 53 | } |
54 | 54 |
@@ -45,6 +45,7 @@ |
||
45 | 45 | * {@inheritDoc} |
46 | 46 | * |
47 | 47 | * @param MultiGetCache $cache |
48 | + * @param string $name |
|
48 | 49 | */ |
49 | 50 | public function __construct($name, MultiGetCache $cache, $lifetime = 0) |
50 | 51 | { |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Cache\Region; |
7 | 7 |
@@ -23,7 +23,6 @@ |
||
23 | 23 | |
24 | 24 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
25 | 25 | use PDO; |
26 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
27 | 26 | |
28 | 27 | /** |
29 | 28 | * The ArrayHydrator produces a nested array "graph" that is often (not always) |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Internal\Hydration; |
6 | 6 | |
@@ -97,10 +97,10 @@ discard block |
||
97 | 97 | // It's a joined result |
98 | 98 | |
99 | 99 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
100 | - $path = $parent . '.' . $dqlAlias; |
|
100 | + $path = $parent.'.'.$dqlAlias; |
|
101 | 101 | |
102 | 102 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
103 | - if ( ! isset($nonemptyComponents[$parent]) ) { |
|
103 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
104 | 104 | continue; |
105 | 105 | } |
106 | 106 | |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
110 | 110 | $first = reset($this->resultPointers); |
111 | 111 | // TODO: Exception if $key === null ? |
112 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
112 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
113 | 113 | } else if (isset($this->resultPointers[$parent])) { |
114 | - $baseElement =& $this->resultPointers[$parent]; |
|
114 | + $baseElement = & $this->resultPointers[$parent]; |
|
115 | 115 | } else { |
116 | 116 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
117 | 117 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $relation = $parentClass->getProperty($relationAlias); |
124 | 124 | |
125 | 125 | // Check the type of the relation (many or single-valued) |
126 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
126 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
127 | 127 | $oneToOne = false; |
128 | 128 | |
129 | 129 | if ( ! isset($baseElement[$relationAlias])) { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } |
163 | 163 | } |
164 | 164 | |
165 | - $coll =& $baseElement[$relationAlias]; |
|
165 | + $coll = & $baseElement[$relationAlias]; |
|
166 | 166 | |
167 | 167 | if (is_array($coll)) { |
168 | 168 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
175 | 175 | |
176 | 176 | // if this row has a NULL value for the root result id then make it a null result. |
177 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
177 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
178 | 178 | $result[] = $this->rsm->isMixed |
179 | 179 | ? [$entityKey => null] |
180 | 180 | : null; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $resultKey = $this->resultCounter - 1; |
236 | 236 | } |
237 | 237 | |
238 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
238 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
239 | 239 | $onlyOneRootAlias = 0 === $scalarCount && 1 === count($rowData['newObjects']); |
240 | 240 | |
241 | 241 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
@@ -274,13 +274,13 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | if ($oneToOne) { |
277 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
277 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
278 | 278 | |
279 | 279 | return; |
280 | 280 | } |
281 | 281 | |
282 | 282 | if ($index !== false) { |
283 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
283 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
284 | 284 | |
285 | 285 | return; |
286 | 286 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | } |
291 | 291 | |
292 | 292 | end($coll); |
293 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
293 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
294 | 294 | |
295 | 295 | return; |
296 | 296 | } |
@@ -207,7 +207,6 @@ |
||
207 | 207 | |
208 | 208 | /** |
209 | 209 | * @param ClassMetadata $targetClass |
210 | - * @param array $assoc |
|
211 | 210 | * @param mixed $actualValue |
212 | 211 | * |
213 | 212 | * @return self |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | use Doctrine\ORM\Mapping\AssociationMetadata; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | static public function scheduleInsertForManagedEntity($entity) |
23 | 23 | { |
24 | - return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
24 | + return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | static public function scheduleInsertForRemovedEntity($entity) |
33 | 33 | { |
34 | - return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
34 | + return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | static public function scheduleInsertTwice($entity) |
43 | 43 | { |
44 | - return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice."); |
|
44 | + return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice."); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | static public function entityWithoutIdentity($className, $entity) |
54 | 54 | { |
55 | 55 | return new self( |
56 | - "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " . |
|
56 | + "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ". |
|
57 | 57 | "id values set. It cannot be added to the identity map." |
58 | 58 | ); |
59 | 59 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | static public function readOnlyRequiresManagedEntity($entity) |
67 | 67 | { |
68 | - return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not"); |
|
68 | + return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not"); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | static public function entityNotManaged($entity) |
123 | 123 | { |
124 | - return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " . |
|
124 | + return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ". |
|
125 | 125 | "from the database or registered as new through EntityManager#persist"); |
126 | 126 | } |
127 | 127 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | static public function entityHasNoIdentity($entity, $operation) |
135 | 135 | { |
136 | - return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
136 | + return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | static public function entityIsRemoved($entity, $operation) |
146 | 146 | { |
147 | - return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
147 | + return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | static public function detachedEntityCannot($entity, $operation) |
157 | 157 | { |
158 | - return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation); |
|
158 | + return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public static function invalidObject($context, $given, $parameterIndex = 1) |
169 | 169 | { |
170 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
171 | - ' to be an entity object, '. gettype($given) . ' given.'); |
|
170 | + return new self($context.' expects parameter '.$parameterIndex. |
|
171 | + ' to be an entity object, '.gettype($given).' given.'); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public static function invalidCompositeIdentifier() |
178 | 178 | { |
179 | - return new self("Binding an entity with a composite primary key to a query is not supported. " . |
|
179 | + return new self("Binding an entity with a composite primary key to a query is not supported. ". |
|
180 | 180 | "You should split the parameter into the explicit fields and bind them separately."); |
181 | 181 | } |
182 | 182 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @param string $field |
121 | 121 | * @param array $args |
122 | 122 | * |
123 | - * @return object |
|
123 | + * @return PersistentObject |
|
124 | 124 | * |
125 | 125 | * @throws \BadMethodCallException When no persistent field exists by that name. |
126 | 126 | * @throws \InvalidArgumentException When the wrong target object type is passed to an association. |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @param string $field |
208 | 208 | * @param array $args |
209 | 209 | * |
210 | - * @return object |
|
210 | + * @return PersistentObject |
|
211 | 211 | * |
212 | 212 | * @throws \BadMethodCallException |
213 | 213 | * @throws \InvalidArgumentException |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | if ($entityManager !== self::$entityManager) { |
91 | 91 | throw new \RuntimeException( |
92 | - "Trying to use PersistentObject with different EntityManager instances. " . |
|
92 | + "Trying to use PersistentObject with different EntityManager instances. ". |
|
93 | 93 | "Was PersistentObject::setEntityManager() called?" |
94 | 94 | ); |
95 | 95 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $property = $this->cm->getProperty($field); |
116 | 116 | |
117 | - if (! $property) { |
|
117 | + if ( ! $property) { |
|
118 | 118 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
119 | 119 | } |
120 | 120 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | $property = $this->cm->getProperty($field); |
155 | 155 | |
156 | - if (! $property) { |
|
156 | + if ( ! $property) { |
|
157 | 157 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
158 | 158 | } |
159 | 159 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $mappedByField = $property->getMappedBy(); |
180 | 180 | $targetMetadata = self::$entityManager->getClassMetadata($property->getTargetEntity()); |
181 | 181 | $targetProperty = $targetMetadata->getProperty($mappedByField); |
182 | - $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField; |
|
182 | + $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField; |
|
183 | 183 | |
184 | 184 | $targetObject->$setterMethodName($this); |
185 | 185 | } |
@@ -201,21 +201,21 @@ discard block |
||
201 | 201 | |
202 | 202 | $property = $this->cm->getProperty($field); |
203 | 203 | |
204 | - if (! $property) { |
|
204 | + if ( ! $property) { |
|
205 | 205 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
206 | 206 | } |
207 | 207 | |
208 | - if (! ($property instanceof ToManyAssociationMetadata)) { |
|
208 | + if ( ! ($property instanceof ToManyAssociationMetadata)) { |
|
209 | 209 | throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getClassName()); |
210 | 210 | } |
211 | 211 | |
212 | 212 | $targetClassName = $property->getTargetEntity(); |
213 | 213 | |
214 | - if (! ($args[0] instanceof $targetClassName)) { |
|
214 | + if ( ! ($args[0] instanceof $targetClassName)) { |
|
215 | 215 | throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
216 | 216 | } |
217 | 217 | |
218 | - if (! ($this->$field instanceof Collection)) { |
|
218 | + if ( ! ($this->$field instanceof Collection)) { |
|
219 | 219 | $this->$field = new ArrayCollection($this->$field ?: []); |
220 | 220 | } |
221 | 221 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | return; |
240 | 240 | } |
241 | 241 | |
242 | - if (!self::$entityManager) { |
|
242 | + if ( ! self::$entityManager) { |
|
243 | 243 | throw new \RuntimeException("No runtime entity manager set. Call PersistentObject#setEntityManager()."); |
244 | 244 | } |
245 | 245 |
@@ -22,7 +22,6 @@ |
||
22 | 22 | namespace Doctrine\ORM\Persisters\Collection; |
23 | 23 | |
24 | 24 | use Doctrine\Common\Collections\Criteria; |
25 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
26 | 25 | use Doctrine\ORM\Mapping\InheritanceType; |
27 | 26 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
28 | 27 | use Doctrine\ORM\PersistentCollection; |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | return (bool) $persister->count($criteria); |
146 | 146 | } |
147 | 147 | |
148 | - /** |
|
149 | - * {@inheritdoc} |
|
150 | - */ |
|
148 | + /** |
|
149 | + * {@inheritdoc} |
|
150 | + */ |
|
151 | 151 | public function contains(PersistentCollection $collection, $element) |
152 | 152 | { |
153 | 153 | if ( ! $this->isValidEntityState($element)) { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | |
266 | 266 | // 2) Build insert table records into temporary table |
267 | 267 | $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
268 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
268 | + . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
269 | 269 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
270 | 270 | |
271 | 271 | $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Persisters\Collection; |
6 | 6 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // the entire collection with a new would trigger this operation. |
31 | 31 | $association = $collection->getMapping(); |
32 | 32 | |
33 | - if (! $association->isOrphanRemoval()) { |
|
33 | + if ( ! $association->isOrphanRemoval()) { |
|
34 | 34 | // Handling non-orphan removal should never happen, as @OneToMany |
35 | 35 | // can only be inverse side. For owning side one to many, it is |
36 | 36 | // required to have a join table, which would classify as a ManyToManyPersister. |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | $association = $collection->getMapping(); |
64 | 64 | |
65 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
65 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
66 | 66 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
67 | 67 | } |
68 | 68 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $association = $collection->getMapping(); |
113 | 113 | |
114 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
114 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
115 | 115 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
116 | 116 | } |
117 | 117 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | // only works with single id identifier entities. Will throw an |
121 | 121 | // exception in Entity Persisters if that is not the case for the |
122 | 122 | // 'mappedBy' field. |
123 | - $criteria = [ |
|
123 | + $criteria = [ |
|
124 | 124 | $association->getMappedBy() => $collection->getOwner(), |
125 | 125 | $association->getIndexedBy() => $key, |
126 | 126 | ]; |
@@ -157,12 +157,12 @@ discard block |
||
157 | 157 | { |
158 | 158 | $association = $collection->getMapping(); |
159 | 159 | |
160 | - if (! $association->isOrphanRemoval()) { |
|
160 | + if ( ! $association->isOrphanRemoval()) { |
|
161 | 161 | // no-op: this is not the owning side, therefore no operations should be applied |
162 | 162 | return false; |
163 | 163 | } |
164 | 164 | |
165 | - if (! $this->isValidEntityState($element)) { |
|
165 | + if ( ! $this->isValidEntityState($element)) { |
|
166 | 166 | return false; |
167 | 167 | } |
168 | 168 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
205 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
205 | + $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
206 | 206 | |
207 | 207 | return $this->conn->executeUpdate($statement, $parameters); |
208 | 208 | } |
@@ -241,17 +241,17 @@ discard block |
||
241 | 241 | ]; |
242 | 242 | } |
243 | 243 | |
244 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
245 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
244 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
245 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
246 | 246 | |
247 | 247 | $this->conn->executeUpdate($statement); |
248 | 248 | |
249 | 249 | // 2) Build insert table records into temporary table |
250 | - $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
251 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
250 | + $dql = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
251 | + . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner'; |
|
252 | 252 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
253 | 253 | |
254 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
|
254 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL(); |
|
255 | 255 | $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner())); |
256 | 256 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
257 | 257 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | // 4) Delete records on each table in the hierarchy |
267 | 267 | $hierarchyClasses = array_merge( |
268 | 268 | array_map( |
269 | - function ($className) { return $this->em->getClassMetadata($className); }, |
|
269 | + function($className) { return $this->em->getClassMetadata($className); }, |
|
270 | 270 | array_reverse($targetClass->getSubClasses()) |
271 | 271 | ), |
272 | 272 | [$targetClass], |
@@ -1409,7 +1409,6 @@ |
||
1409 | 1409 | * Gets the SQL join fragment used when selecting entities from a |
1410 | 1410 | * many-to-many association. |
1411 | 1411 | * |
1412 | - * @param ManyToManyAssociationMetadata $manyToMany |
|
1413 | 1412 | * |
1414 | 1413 | * @return string |
1415 | 1414 | */ |
@@ -323,8 +323,8 @@ discard block |
||
323 | 323 | |
324 | 324 | // FIXME: Order with composite keys might not be correct |
325 | 325 | $sql = 'SELECT ' . $columnName |
326 | - . ' FROM ' . $tableName |
|
327 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
326 | + . ' FROM ' . $tableName |
|
327 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
328 | 328 | |
329 | 329 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
330 | 330 | $versionType = $versionProperty->getType(); |
@@ -457,8 +457,8 @@ discard block |
||
457 | 457 | } |
458 | 458 | |
459 | 459 | $sql = 'UPDATE ' . $quotedTableName |
460 | - . ' SET ' . implode(', ', $set) |
|
461 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
460 | + . ' SET ' . implode(', ', $set) |
|
461 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
462 | 462 | |
463 | 463 | $result = $this->conn->executeUpdate($sql, $params, $types); |
464 | 464 | |
@@ -1626,9 +1626,9 @@ discard block |
||
1626 | 1626 | $lock = $this->getLockTablesSql($lockMode); |
1627 | 1627 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
1628 | 1628 | $sql = 'SELECT 1 ' |
1629 | - . $lock |
|
1630 | - . $where |
|
1631 | - . $lockSql; |
|
1629 | + . $lock |
|
1630 | + . $where |
|
1631 | + . $lockSql; |
|
1632 | 1632 | |
1633 | 1633 | list($params, $types) = $this->expandParameters($criteria); |
1634 | 1634 | |
@@ -2107,8 +2107,8 @@ discard block |
||
2107 | 2107 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
2108 | 2108 | |
2109 | 2109 | $sql = 'SELECT 1 ' |
2110 | - . $this->getLockTablesSql(null) |
|
2111 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2110 | + . $this->getLockTablesSql(null) |
|
2111 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2112 | 2112 | |
2113 | 2113 | list($params, $types) = $this->expandParameters($criteria); |
2114 | 2114 | |
@@ -2142,9 +2142,9 @@ discard block |
||
2142 | 2142 | |
2143 | 2143 | // if one of the join columns is nullable, return left join |
2144 | 2144 | foreach ($association->getJoinColumns() as $joinColumn) { |
2145 | - if (! $joinColumn->isNullable()) { |
|
2146 | - continue; |
|
2147 | - } |
|
2145 | + if (! $joinColumn->isNullable()) { |
|
2146 | + continue; |
|
2147 | + } |
|
2148 | 2148 | |
2149 | 2149 | return 'LEFT JOIN'; |
2150 | 2150 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Persisters\Entity; |
6 | 6 | |
@@ -301,14 +301,14 @@ discard block |
||
301 | 301 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
302 | 302 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
303 | 303 | $identifier = array_map( |
304 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
304 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
305 | 305 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
306 | 306 | ); |
307 | 307 | |
308 | 308 | // FIXME: Order with composite keys might not be correct |
309 | - $sql = 'SELECT ' . $columnName |
|
310 | - . ' FROM ' . $tableName |
|
311 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
309 | + $sql = 'SELECT '.$columnName |
|
310 | + . ' FROM '.$tableName |
|
311 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
312 | 312 | |
313 | 313 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
314 | 314 | $versionType = $versionProperty->getType(); |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | if (($value = $identifier[$field]) !== null) { |
396 | 396 | // @todo guilhermeblanco Make sure we do not have flat association values. |
397 | - if (! is_array($value)) { |
|
397 | + if ( ! is_array($value)) { |
|
398 | 398 | $value = [$targetClass->identifier[0] => $value]; |
399 | 399 | } |
400 | 400 | |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
408 | 408 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
409 | 409 | |
410 | - if (! $joinColumn->getType()) { |
|
410 | + if ( ! $joinColumn->getType()) { |
|
411 | 411 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
412 | 412 | } |
413 | 413 | |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
476 | 476 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
477 | 477 | |
478 | - if (! $joinColumn->getType()) { |
|
478 | + if ( ! $joinColumn->getType()) { |
|
479 | 479 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
480 | 480 | } |
481 | 481 | |
@@ -502,18 +502,18 @@ discard block |
||
502 | 502 | case Type::SMALLINT: |
503 | 503 | case Type::INTEGER: |
504 | 504 | case Type::BIGINT: |
505 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
505 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
506 | 506 | break; |
507 | 507 | |
508 | 508 | case Type::DATETIME: |
509 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
509 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
510 | 510 | break; |
511 | 511 | } |
512 | 512 | } |
513 | 513 | |
514 | - $sql = 'UPDATE ' . $quotedTableName |
|
515 | - . ' SET ' . implode(', ', $set) |
|
516 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
514 | + $sql = 'UPDATE '.$quotedTableName |
|
515 | + . ' SET '.implode(', ', $set) |
|
516 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
517 | 517 | |
518 | 518 | $result = $this->conn->executeUpdate($sql, $params, $types); |
519 | 519 | |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | protected function deleteJoinTableRecords($identifier) |
533 | 533 | { |
534 | 534 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
535 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
535 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
536 | 536 | continue; |
537 | 537 | } |
538 | 538 | |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | $keys = []; |
546 | 546 | |
547 | 547 | if ( ! $owningAssociation->isOwningSide()) { |
548 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
548 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
549 | 549 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
550 | 550 | } |
551 | 551 | |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | } |
658 | 658 | |
659 | 659 | // Only owning side of x-1 associations can have a FK column. |
660 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
660 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
661 | 661 | continue; |
662 | 662 | } |
663 | 663 | |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | /** @var JoinColumnMetadata $joinColumn */ |
678 | 678 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
679 | 679 | |
680 | - if (! $joinColumn->getType()) { |
|
680 | + if ( ! $joinColumn->getType()) { |
|
681 | 681 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
682 | 682 | } |
683 | 683 | |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | $propertyName = $this->class->fieldNames[$columnName]; |
707 | 707 | $property = $this->class->getProperty($propertyName); |
708 | 708 | |
709 | - if (! $property) { |
|
709 | + if ( ! $property) { |
|
710 | 710 | return null; |
711 | 711 | } |
712 | 712 | |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | /** @var JoinColumnMetadata $joinColumn */ |
726 | 726 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
727 | 727 | |
728 | - if (! $joinColumn->getType()) { |
|
728 | + if ( ! $joinColumn->getType()) { |
|
729 | 729 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
730 | 730 | } |
731 | 731 | |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | // unset the old value and set the new sql aliased value here. By definition |
843 | 843 | // unset($identifier[$targetKeyColumn] works here with how UnitOfWork::createEntity() calls this method. |
844 | 844 | // @todo guilhermeblanco In master we have: $identifier[$targetClass->getFieldForColumn($targetKeyColumn)] = |
845 | - $identifier[$targetTableAlias . "." . $targetKeyColumn] = $value; |
|
845 | + $identifier[$targetTableAlias.".".$targetKeyColumn] = $value; |
|
846 | 846 | |
847 | 847 | unset($identifier[$targetKeyColumn]); |
848 | 848 | } |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | $criteria = []; |
1063 | 1063 | $parameters = []; |
1064 | 1064 | |
1065 | - if (! $association->isOwningSide()) { |
|
1065 | + if ( ! $association->isOwningSide()) { |
|
1066 | 1066 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1067 | 1067 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1068 | 1068 | } |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | $value = $value[$targetClass->identifier[0]]; |
1091 | 1091 | } |
1092 | 1092 | |
1093 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1093 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1094 | 1094 | $parameters[] = [ |
1095 | 1095 | 'value' => $value, |
1096 | 1096 | 'field' => $fieldName, |
@@ -1141,11 +1141,11 @@ discard block |
||
1141 | 1141 | |
1142 | 1142 | switch ($lockMode) { |
1143 | 1143 | case LockMode::PESSIMISTIC_READ: |
1144 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1144 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1145 | 1145 | break; |
1146 | 1146 | |
1147 | 1147 | case LockMode::PESSIMISTIC_WRITE: |
1148 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1148 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1149 | 1149 | break; |
1150 | 1150 | } |
1151 | 1151 | |
@@ -1156,14 +1156,14 @@ discard block |
||
1156 | 1156 | |
1157 | 1157 | if ('' !== $filterSql) { |
1158 | 1158 | $conditionSql = $conditionSql |
1159 | - ? $conditionSql . ' AND ' . $filterSql |
|
1159 | + ? $conditionSql.' AND '.$filterSql |
|
1160 | 1160 | : $filterSql; |
1161 | 1161 | } |
1162 | 1162 | |
1163 | - $select = 'SELECT ' . $columnList; |
|
1164 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1165 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1166 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1163 | + $select = 'SELECT '.$columnList; |
|
1164 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1165 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1166 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1167 | 1167 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1168 | 1168 | $query = $select |
1169 | 1169 | . $lock |
@@ -1171,7 +1171,7 @@ discard block |
||
1171 | 1171 | . $where |
1172 | 1172 | . $orderBySql; |
1173 | 1173 | |
1174 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1174 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1175 | 1175 | } |
1176 | 1176 | |
1177 | 1177 | /** |
@@ -1190,13 +1190,13 @@ discard block |
||
1190 | 1190 | |
1191 | 1191 | if ('' !== $filterSql) { |
1192 | 1192 | $conditionSql = $conditionSql |
1193 | - ? $conditionSql . ' AND ' . $filterSql |
|
1193 | + ? $conditionSql.' AND '.$filterSql |
|
1194 | 1194 | : $filterSql; |
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | $sql = 'SELECT COUNT(*) ' |
1198 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1199 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1198 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1199 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1200 | 1200 | |
1201 | 1201 | return $sql; |
1202 | 1202 | } |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | */ |
1214 | 1214 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
1215 | 1215 | { |
1216 | - if (! $orderBy) { |
|
1216 | + if ( ! $orderBy) { |
|
1217 | 1217 | return ''; |
1218 | 1218 | } |
1219 | 1219 | |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | foreach ($orderBy as $fieldName => $orientation) { |
1223 | 1223 | $orientation = strtoupper(trim($orientation)); |
1224 | 1224 | |
1225 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
1225 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
1226 | 1226 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
1227 | 1227 | } |
1228 | 1228 | |
@@ -1232,11 +1232,11 @@ discard block |
||
1232 | 1232 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1233 | 1233 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1234 | 1234 | |
1235 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1235 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1236 | 1236 | |
1237 | 1237 | continue; |
1238 | 1238 | } else if ($property instanceof AssociationMetadata) { |
1239 | - if (! $property->isOwningSide()) { |
|
1239 | + if ( ! $property->isOwningSide()) { |
|
1240 | 1240 | throw InvalidFindByInverseAssociation::becauseIsInverseAssociation( |
1241 | 1241 | $this->class->getClassName(), |
1242 | 1242 | $fieldName |
@@ -1252,7 +1252,7 @@ discard block |
||
1252 | 1252 | /* @var JoinColumnMetadata $joinColumn */ |
1253 | 1253 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1254 | 1254 | |
1255 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1255 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1256 | 1256 | } |
1257 | 1257 | |
1258 | 1258 | continue; |
@@ -1261,7 +1261,7 @@ discard block |
||
1261 | 1261 | throw ORMException::unrecognizedField($fieldName); |
1262 | 1262 | } |
1263 | 1263 | |
1264 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1264 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1265 | 1265 | } |
1266 | 1266 | |
1267 | 1267 | /** |
@@ -1283,7 +1283,7 @@ discard block |
||
1283 | 1283 | |
1284 | 1284 | |
1285 | 1285 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
1286 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1286 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1287 | 1287 | |
1288 | 1288 | $eagerAliasCounter = 0; |
1289 | 1289 | $columnList = []; |
@@ -1319,7 +1319,7 @@ discard block |
||
1319 | 1319 | break; // now this is why you shouldn't use inheritance |
1320 | 1320 | } |
1321 | 1321 | |
1322 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1322 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1323 | 1323 | |
1324 | 1324 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1325 | 1325 | |
@@ -1344,14 +1344,14 @@ discard block |
||
1344 | 1344 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1345 | 1345 | } |
1346 | 1346 | |
1347 | - if (! $property->isOwningSide()) { |
|
1347 | + if ( ! $property->isOwningSide()) { |
|
1348 | 1348 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1349 | 1349 | } |
1350 | 1350 | |
1351 | 1351 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1352 | 1352 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1353 | 1353 | |
1354 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1354 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1355 | 1355 | |
1356 | 1356 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1357 | 1357 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1373,7 +1373,7 @@ discard block |
||
1373 | 1373 | $joinCondition[] = $filterSql; |
1374 | 1374 | } |
1375 | 1375 | |
1376 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1376 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1377 | 1377 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1378 | 1378 | |
1379 | 1379 | break; |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | */ |
1398 | 1398 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1399 | 1399 | { |
1400 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1400 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1401 | 1401 | return ''; |
1402 | 1402 | } |
1403 | 1403 | |
@@ -1412,7 +1412,7 @@ discard block |
||
1412 | 1412 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1413 | 1413 | $resultColumnName = $this->getSQLColumnAlias(); |
1414 | 1414 | |
1415 | - if (! $joinColumn->getType()) { |
|
1415 | + if ( ! $joinColumn->getType()) { |
|
1416 | 1416 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1417 | 1417 | } |
1418 | 1418 | |
@@ -1444,7 +1444,7 @@ discard block |
||
1444 | 1444 | $owningAssociation = $association; |
1445 | 1445 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1446 | 1446 | |
1447 | - if (! $association->isOwningSide()) { |
|
1447 | + if ( ! $association->isOwningSide()) { |
|
1448 | 1448 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1449 | 1449 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1450 | 1450 | } |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | ); |
1467 | 1467 | } |
1468 | 1468 | |
1469 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1469 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1470 | 1470 | } |
1471 | 1471 | |
1472 | 1472 | /** |
@@ -1561,7 +1561,7 @@ discard block |
||
1561 | 1561 | $columnName = $joinColumn->getColumnName(); |
1562 | 1562 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1563 | 1563 | |
1564 | - if (! $joinColumn->getType()) { |
|
1564 | + if ( ! $joinColumn->getType()) { |
|
1565 | 1565 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1566 | 1566 | } |
1567 | 1567 | |
@@ -1600,7 +1600,7 @@ discard block |
||
1600 | 1600 | |
1601 | 1601 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1602 | 1602 | |
1603 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1603 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1604 | 1604 | } |
1605 | 1605 | |
1606 | 1606 | /** |
@@ -1614,14 +1614,14 @@ discard block |
||
1614 | 1614 | protected function getSQLTableAlias($tableName, $assocName = '') |
1615 | 1615 | { |
1616 | 1616 | if ($tableName) { |
1617 | - $tableName .= '#' . $assocName; |
|
1617 | + $tableName .= '#'.$assocName; |
|
1618 | 1618 | } |
1619 | 1619 | |
1620 | 1620 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1621 | 1621 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1622 | 1622 | } |
1623 | 1623 | |
1624 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1624 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1625 | 1625 | |
1626 | 1626 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1627 | 1627 | |
@@ -1648,7 +1648,7 @@ discard block |
||
1648 | 1648 | } |
1649 | 1649 | |
1650 | 1650 | $lock = $this->getLockTablesSql($lockMode); |
1651 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1651 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1652 | 1652 | $sql = 'SELECT 1 ' |
1653 | 1653 | . $lock |
1654 | 1654 | . $where |
@@ -1671,7 +1671,7 @@ discard block |
||
1671 | 1671 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1672 | 1672 | |
1673 | 1673 | return $this->platform->appendLockHint( |
1674 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1674 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1675 | 1675 | $lockMode |
1676 | 1676 | ); |
1677 | 1677 | } |
@@ -1724,19 +1724,19 @@ discard block |
||
1724 | 1724 | |
1725 | 1725 | if (null !== $comparison) { |
1726 | 1726 | // special case null value handling |
1727 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1728 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1727 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1728 | + $selectedColumns[] = $column.' IS NULL'; |
|
1729 | 1729 | |
1730 | 1730 | continue; |
1731 | 1731 | } |
1732 | 1732 | |
1733 | 1733 | if ($comparison === Comparison::NEQ && null === $value) { |
1734 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1734 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1735 | 1735 | |
1736 | 1736 | continue; |
1737 | 1737 | } |
1738 | 1738 | |
1739 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1739 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1740 | 1740 | |
1741 | 1741 | continue; |
1742 | 1742 | } |
@@ -1785,7 +1785,7 @@ discard block |
||
1785 | 1785 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1786 | 1786 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1787 | 1787 | |
1788 | - return [$tableAlias . '.' . $columnName]; |
|
1788 | + return [$tableAlias.'.'.$columnName]; |
|
1789 | 1789 | } |
1790 | 1790 | |
1791 | 1791 | if ($property instanceof AssociationMetadata) { |
@@ -1794,7 +1794,7 @@ discard block |
||
1794 | 1794 | |
1795 | 1795 | // Many-To-Many requires join table check for joinColumn |
1796 | 1796 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1797 | - if (! $owningAssociation->isOwningSide()) { |
|
1797 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1798 | 1798 | $owningAssociation = $association; |
1799 | 1799 | } |
1800 | 1800 | |
@@ -1808,18 +1808,18 @@ discard block |
||
1808 | 1808 | foreach ($joinColumns as $joinColumn) { |
1809 | 1809 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1810 | 1810 | |
1811 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1811 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1812 | 1812 | } |
1813 | 1813 | |
1814 | 1814 | } else { |
1815 | - if (! $owningAssociation->isOwningSide()) { |
|
1815 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1816 | 1816 | throw InvalidFindByInverseAssociation::becauseIsInverseAssociation( |
1817 | 1817 | $this->class->getClassName(), |
1818 | 1818 | $field |
1819 | 1819 | ); |
1820 | 1820 | } |
1821 | 1821 | |
1822 | - $class = $this->class->isInheritedProperty($field) |
|
1822 | + $class = $this->class->isInheritedProperty($field) |
|
1823 | 1823 | ? $owningAssociation->getDeclaringClass() |
1824 | 1824 | : $this->class |
1825 | 1825 | ; |
@@ -1828,7 +1828,7 @@ discard block |
||
1828 | 1828 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1829 | 1829 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1830 | 1830 | |
1831 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1831 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1832 | 1832 | } |
1833 | 1833 | } |
1834 | 1834 | |
@@ -1941,7 +1941,7 @@ discard block |
||
1941 | 1941 | $value = $value[$targetClass->identifier[0]]; |
1942 | 1942 | } |
1943 | 1943 | |
1944 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
1944 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
1945 | 1945 | $parameters[] = [ |
1946 | 1946 | 'value' => $value, |
1947 | 1947 | 'field' => $fieldName, |
@@ -2028,7 +2028,7 @@ discard block |
||
2028 | 2028 | case ($property instanceof AssociationMetadata): |
2029 | 2029 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2030 | 2030 | |
2031 | - if (! $property->isOwningSide()) { |
|
2031 | + if ( ! $property->isOwningSide()) { |
|
2032 | 2032 | $property = $class->getProperty($property->getMappedBy()); |
2033 | 2033 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2034 | 2034 | } |
@@ -2042,7 +2042,7 @@ discard block |
||
2042 | 2042 | /** @var JoinColumnMetadata $joinColumn */ |
2043 | 2043 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2044 | 2044 | |
2045 | - if (! $joinColumn->getType()) { |
|
2045 | + if ( ! $joinColumn->getType()) { |
|
2046 | 2046 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2047 | 2047 | } |
2048 | 2048 | |
@@ -2057,7 +2057,7 @@ discard block |
||
2057 | 2057 | } |
2058 | 2058 | |
2059 | 2059 | if (is_array($value)) { |
2060 | - return array_map(function ($type) { |
|
2060 | + return array_map(function($type) { |
|
2061 | 2061 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2062 | 2062 | }, $types); |
2063 | 2063 | } |
@@ -2136,12 +2136,12 @@ discard block |
||
2136 | 2136 | |
2137 | 2137 | $sql = 'SELECT 1 ' |
2138 | 2138 | . $this->getLockTablesSql(null) |
2139 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2139 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2140 | 2140 | |
2141 | 2141 | list($params, $types) = $this->expandParameters($criteria); |
2142 | 2142 | |
2143 | 2143 | if (null !== $extraConditions) { |
2144 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2144 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2145 | 2145 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2146 | 2146 | |
2147 | 2147 | $params = array_merge($params, $criteriaParams); |
@@ -2149,7 +2149,7 @@ discard block |
||
2149 | 2149 | } |
2150 | 2150 | |
2151 | 2151 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2152 | - $sql .= ' AND ' . $filterSql; |
|
2152 | + $sql .= ' AND '.$filterSql; |
|
2153 | 2153 | } |
2154 | 2154 | |
2155 | 2155 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2164,13 +2164,13 @@ discard block |
||
2164 | 2164 | */ |
2165 | 2165 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2166 | 2166 | { |
2167 | - if (! $association->isOwningSide()) { |
|
2167 | + if ( ! $association->isOwningSide()) { |
|
2168 | 2168 | return 'LEFT JOIN'; |
2169 | 2169 | } |
2170 | 2170 | |
2171 | 2171 | // if one of the join columns is nullable, return left join |
2172 | 2172 | foreach ($association->getJoinColumns() as $joinColumn) { |
2173 | - if (! $joinColumn->isNullable()) { |
|
2173 | + if ( ! $joinColumn->isNullable()) { |
|
2174 | 2174 | continue; |
2175 | 2175 | } |
2176 | 2176 | |
@@ -2187,7 +2187,7 @@ discard block |
||
2187 | 2187 | */ |
2188 | 2188 | public function getSQLColumnAlias() |
2189 | 2189 | { |
2190 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2190 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2191 | 2191 | } |
2192 | 2192 | |
2193 | 2193 | /** |
@@ -2204,13 +2204,13 @@ discard block |
||
2204 | 2204 | |
2205 | 2205 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2206 | 2206 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2207 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2207 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2208 | 2208 | } |
2209 | 2209 | } |
2210 | 2210 | |
2211 | 2211 | $sql = implode(' AND ', $filterClauses); |
2212 | 2212 | |
2213 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2213 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2214 | 2214 | } |
2215 | 2215 | |
2216 | 2216 | /** |
@@ -22,9 +22,7 @@ |
||
22 | 22 | namespace Doctrine\ORM\Query\Exec; |
23 | 23 | |
24 | 24 | use Doctrine\DBAL\Connection; |
25 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
26 | 25 | use Doctrine\ORM\Query\AST; |
27 | -use Doctrine\ORM\Utility\PersisterHelper; |
|
28 | 26 | |
29 | 27 | /** |
30 | 28 | * Executes the SQL statements for bulk DQL DELETE statements on classes in |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Query\Exec; |
6 | 6 | |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
62 | 62 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 'i0', $primaryDqlAlias); |
63 | 63 | |
64 | - $this->insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ')' |
|
65 | - . ' SELECT i0.' . implode(', i0.', array_keys($idColumns)); |
|
64 | + $this->insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.')' |
|
65 | + . ' SELECT i0.'.implode(', i0.', array_keys($idColumns)); |
|
66 | 66 | |
67 | 67 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->getClassName(), $primaryDqlAlias); |
68 | 68 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | // 3. Create and store DELETE statements |
85 | 85 | $hierarchyClasses = array_merge( |
86 | 86 | array_map( |
87 | - function ($className) use ($em) { return $em->getClassMetadata($className); }, |
|
87 | + function($className) use ($em) { return $em->getClassMetadata($className); }, |
|
88 | 88 | array_reverse($primaryClass->getSubClasses()) |
89 | 89 | ), |
90 | 90 | [$primaryClass], |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | ]; |
106 | 106 | } |
107 | 107 | |
108 | - $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
109 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
108 | + $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
109 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
110 | 110 | |
111 | 111 | $this->dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
112 | 112 | } |
@@ -22,10 +22,8 @@ |
||
22 | 22 | namespace Doctrine\ORM\Query\Exec; |
23 | 23 | |
24 | 24 | use Doctrine\DBAL\Connection; |
25 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
26 | 25 | use Doctrine\ORM\Query\AST; |
27 | 26 | use Doctrine\ORM\Query\ParameterTypeInferer; |
28 | -use Doctrine\ORM\Utility\PersisterHelper; |
|
29 | 27 | |
30 | 28 | /** |
31 | 29 | * Executes the SQL statements for bulk DQL UPDATE statements on classes in |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Query\Exec; |
6 | 6 | |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
73 | 73 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 'i0', $updateClause->aliasIdentificationVariable); |
74 | 74 | |
75 | - $this->insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ')' |
|
76 | - . ' SELECT i0.' . implode(', i0.', array_keys($idColumns)); |
|
75 | + $this->insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.')' |
|
76 | + . ' SELECT i0.'.implode(', i0.', array_keys($idColumns)); |
|
77 | 77 | |
78 | 78 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->getClassName(), $updateClause->aliasIdentificationVariable); |
79 | 79 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | // 3. Create and store UPDATE statements |
92 | 92 | $hierarchyClasses = array_merge( |
93 | 93 | array_map( |
94 | - function ($className) use ($em) { return $em->getClassMetadata($className); }, |
|
94 | + function($className) use ($em) { return $em->getClassMetadata($className); }, |
|
95 | 95 | array_reverse($primaryClass->getSubClasses()) |
96 | 96 | ), |
97 | 97 | [$primaryClass], |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | ]; |
146 | 146 | } |
147 | 147 | |
148 | - $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
149 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
148 | + $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
149 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
150 | 150 | |
151 | 151 | $this->dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
152 | 152 | } |