@@ -130,7 +130,7 @@ |
||
130 | 130 | { |
131 | 131 | $this->expectException(MappingException::class); |
132 | 132 | $this->expectExceptionMessage( |
133 | - 'Entity \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' has to be part of the discriminator map' |
|
133 | + 'Entity \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' has to be part of the discriminator map' |
|
134 | 134 | . ' of \'Doctrine\Tests\ORM\Mapping\HierarchyBase\' to be properly mapped in the inheritance hierarchy.' |
135 | 135 | . ' Alternatively you can make \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' an abstract class to' |
136 | 136 | . ' avoid this exception from occurring.' |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Mapping; |
6 | 6 |
@@ -24,18 +24,18 @@ |
||
24 | 24 | public $avatar; |
25 | 25 | |
26 | 26 | public function getId() { |
27 | - return $this->id; |
|
27 | + return $this->id; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function getUsername() { |
31 | - return $this->username; |
|
31 | + return $this->username; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function getAvatar() { |
35 | - return $this->avatar; |
|
35 | + return $this->avatar; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function setAvatar(ForumAvatar $avatar) { |
39 | - $this->avatar = $avatar; |
|
39 | + $this->avatar = $avatar; |
|
40 | 40 | } |
41 | 41 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\Models\Forum; |
6 | 6 |
@@ -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 |
@@ -23,7 +23,6 @@ |
||
23 | 23 | namespace Doctrine\ORM\Cache; |
24 | 24 | |
25 | 25 | use Doctrine\Common\Util\ClassUtils; |
26 | - |
|
27 | 26 | use Doctrine\ORM\Mapping\FetchMode; |
28 | 27 | use Doctrine\ORM\Mapping\FieldMetadata; |
29 | 28 | use Doctrine\ORM\Mapping\OneToOneAssociationMetadata; |
@@ -1,7 +1,7 @@ discard block |
||
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; |
7 | 7 | |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | $data = array_merge($data, $persister->getIdentifier($entity)); // why update has no identifier values ? |
60 | 60 | |
61 | 61 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $association) { |
62 | - if (! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
62 | + if ( ! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
66 | - if (! $association instanceof ToOneAssociationMetadata) { |
|
66 | + if ( ! $association instanceof ToOneAssociationMetadata) { |
|
67 | 67 | unset($data[$name]); |
68 | 68 | |
69 | 69 | continue; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $targetClassMetadata = $this->em->getClassMetadata($targetEntity); |
74 | 74 | $targetPersister = $this->uow->getEntityPersister($targetEntity); |
75 | 75 | |
76 | - if (! $association->getCache()) { |
|
76 | + if ( ! $association->getCache()) { |
|
77 | 77 | $owningAssociation = ! $association->isOwningSide() |
78 | 78 | ? $targetClassMetadata->getProperty($association->getMappedBy()) |
79 | 79 | : $association; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | continue; |
122 | 122 | } |
123 | 123 | |
124 | - if (! $association->isPrimaryKey()) { |
|
124 | + if ( ! $association->isPrimaryKey()) { |
|
125 | 125 | $targetClass = ClassUtils::getClass($data[$name]); |
126 | 126 | $targetId = $this->uow->getEntityIdentifier($data[$name]); |
127 | 127 | $data[$name] = new AssociationCacheEntry($targetClass, $targetId); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | ($association instanceof OneToOneAssociationMetadata && ! $association->isOwningSide()) |
172 | 172 | ); |
173 | 173 | |
174 | - if (! $isEagerLoad) { |
|
174 | + if ( ! $isEagerLoad) { |
|
175 | 175 | $data[$name] = $this->em->getReference($assocClass, $assocId); |
176 | 176 | |
177 | 177 | continue; |
@@ -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], |