@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $pkColumns = []; |
177 | 177 | |
178 | 178 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
179 | - if (! ($property instanceof FieldMetadata)) { |
|
179 | + if ( ! ($property instanceof FieldMetadata)) { |
|
180 | 180 | continue; |
181 | 181 | } |
182 | 182 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | $this->gatherColumn($class, $property, $table); |
190 | 190 | |
191 | - if (! $class->isIdentifier($fieldName)) { |
|
191 | + if ( ! $class->isIdentifier($fieldName)) { |
|
192 | 192 | continue; |
193 | 193 | } |
194 | 194 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | foreach ($class->identifier as $identifierField) { |
208 | 208 | $idProperty = $class->getProperty($identifierField); |
209 | 209 | |
210 | - if (! $class->isInheritedProperty($identifierField)) { |
|
210 | + if ( ! $class->isInheritedProperty($identifierField)) { |
|
211 | 211 | continue; |
212 | 212 | } |
213 | 213 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $inheritedKeyColumns[] = $columnName; |
222 | 222 | } |
223 | 223 | |
224 | - if (! empty($inheritedKeyColumns)) { |
|
224 | + if ( ! empty($inheritedKeyColumns)) { |
|
225 | 225 | // Add a FK constraint on the ID column |
226 | 226 | $rootClass = $this->em->getClassMetadata($class->getRootClassName()); |
227 | 227 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | continue; |
260 | 260 | } |
261 | 261 | |
262 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
262 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
263 | 263 | continue; |
264 | 264 | } |
265 | 265 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
271 | - if (! $table->hasIndex('primary')) { |
|
271 | + if ( ! $table->hasIndex('primary')) { |
|
272 | 272 | $table->setPrimaryKey($pkColumns); |
273 | 273 | } |
274 | 274 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $primaryKey = $table->getIndex('primary'); |
279 | 279 | |
280 | 280 | foreach ($table->getIndexes() as $idxKey => $existingIndex) { |
281 | - if (! $primaryKey->overrules($existingIndex)) { |
|
281 | + if ( ! $primaryKey->overrules($existingIndex)) { |
|
282 | 282 | continue; |
283 | 283 | } |
284 | 284 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $processedClasses[$class->getClassName()] = true; |
331 | 331 | |
332 | 332 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
333 | - if (! $property instanceof FieldMetadata |
|
333 | + if ( ! $property instanceof FieldMetadata |
|
334 | 334 | || ! $property->hasValueGenerator() |
335 | 335 | || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE |
336 | 336 | || $class->getClassName() !== $class->getRootClassName()) { |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $schema->createSequence($quotedName, $property->getValueGenerator()->getDefinition()['allocationSize']); |
347 | 347 | } |
348 | 348 | |
349 | - if (! $eventManager->hasListeners(ToolEvents::postGenerateSchemaTable)) { |
|
349 | + if ( ! $eventManager->hasListeners(ToolEvents::postGenerateSchemaTable)) { |
|
350 | 350 | continue; |
351 | 351 | } |
352 | 352 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | ); |
357 | 357 | } |
358 | 358 | |
359 | - if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
359 | + if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
360 | 360 | $schema->visit(new RemoveNamespacedAssets()); |
361 | 361 | } |
362 | 362 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | break; |
396 | 396 | } |
397 | 397 | |
398 | - if (! empty($discrColumn->getColumnDefinition())) { |
|
398 | + if ( ! empty($discrColumn->getColumnDefinition())) { |
|
399 | 399 | $options['columnDefinition'] = $discrColumn->getColumnDefinition(); |
400 | 400 | } |
401 | 401 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | $pkColumns = []; |
414 | 414 | |
415 | 415 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
416 | - if (! ($property instanceof FieldMetadata)) { |
|
416 | + if ( ! ($property instanceof FieldMetadata)) { |
|
417 | 417 | continue; |
418 | 418 | } |
419 | 419 | |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | |
424 | 424 | $this->gatherColumn($class, $property, $table); |
425 | 425 | |
426 | - if (! $property->isPrimaryKey()) { |
|
426 | + if ( ! $property->isPrimaryKey()) { |
|
427 | 427 | continue; |
428 | 428 | } |
429 | 429 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $knownOptions = ['comment', 'unsigned', 'fixed', 'default']; |
480 | 480 | |
481 | 481 | foreach ($knownOptions as $knownOption) { |
482 | - if (! array_key_exists($knownOption, $fieldOptions)) { |
|
482 | + if ( ! array_key_exists($knownOption, $fieldOptions)) { |
|
483 | 483 | continue; |
484 | 484 | } |
485 | 485 | |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks) |
533 | 533 | { |
534 | 534 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
535 | - if (! ($property instanceof AssociationMetadata)) { |
|
535 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
536 | 536 | continue; |
537 | 537 | } |
538 | 538 | |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | continue; |
541 | 541 | } |
542 | 542 | |
543 | - if (! $property->isOwningSide()) { |
|
543 | + if ( ! $property->isOwningSide()) { |
|
544 | 544 | continue; |
545 | 545 | } |
546 | 546 | |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | $idColumns = $class->getIdentifierColumns($this->em); |
631 | 631 | $idColumnNameList = array_keys($idColumns); |
632 | 632 | |
633 | - if (! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
633 | + if ( ! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
634 | 634 | return null; |
635 | 635 | } |
636 | 636 | |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | foreach ($class->getIdentifierFieldNames() as $fieldName) { |
639 | 639 | $property = $class->getProperty($fieldName); |
640 | 640 | |
641 | - if (! ($property instanceof AssociationMetadata)) { |
|
641 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
642 | 642 | continue; |
643 | 643 | } |
644 | 644 | |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | $joinColumn->getReferencedColumnName() |
695 | 695 | ); |
696 | 696 | |
697 | - if (! $definingClass) { |
|
697 | + if ( ! $definingClass) { |
|
698 | 698 | throw MissingColumnException::fromColumnSourceAndTarget( |
699 | 699 | $joinColumn->getReferencedColumnName(), |
700 | 700 | $mapping->getSourceEntity(), |
@@ -709,14 +709,14 @@ discard block |
||
709 | 709 | $localColumns[] = $quotedColumnName; |
710 | 710 | $foreignColumns[] = $quotedReferencedColumnName; |
711 | 711 | |
712 | - if (! $theJoinTable->hasColumn($quotedColumnName)) { |
|
712 | + if ( ! $theJoinTable->hasColumn($quotedColumnName)) { |
|
713 | 713 | // Only add the column to the table if it does not exist already. |
714 | 714 | // It might exist already if the foreign key is mapped into a regular |
715 | 715 | // property as well. |
716 | 716 | $property = $definingClass->getProperty($referencedFieldName); |
717 | 717 | $columnDef = null; |
718 | 718 | |
719 | - if (! empty($joinColumn->getColumnDefinition())) { |
|
719 | + if ( ! empty($joinColumn->getColumnDefinition())) { |
|
720 | 720 | $columnDef = $joinColumn->getColumnDefinition(); |
721 | 721 | } elseif ($property->getColumnDefinition()) { |
722 | 722 | $columnDef = $property->getColumnDefinition(); |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | $theJoinTable->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName); |
764 | 764 | } |
765 | 765 | |
766 | - $compositeName = $theJoinTable->getName() . '.' . implode('', $localColumns); |
|
766 | + $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns); |
|
767 | 767 | |
768 | 768 | if (isset($addedFks[$compositeName]) |
769 | 769 | && ($foreignTableName !== $addedFks[$compositeName]['foreignTableName'] |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | } |
781 | 781 | |
782 | 782 | $blacklistedFks[$compositeName] = true; |
783 | - } elseif (! isset($blacklistedFks[$compositeName])) { |
|
783 | + } elseif ( ! isset($blacklistedFks[$compositeName])) { |
|
784 | 784 | $addedFks[$compositeName] = [ |
785 | 785 | 'foreignTableName' => $foreignTableName, |
786 | 786 | 'foreignColumns' => $foreignColumns, |
@@ -862,10 +862,10 @@ discard block |
||
862 | 862 | $fullSchema = $sm->createSchema(); |
863 | 863 | |
864 | 864 | foreach ($fullSchema->getTables() as $table) { |
865 | - if (! $schema->hasTable($table->getName())) { |
|
865 | + if ( ! $schema->hasTable($table->getName())) { |
|
866 | 866 | foreach ($table->getForeignKeys() as $foreignKey) { |
867 | 867 | /** @var $foreignKey \Doctrine\DBAL\Schema\ForeignKeyConstraint */ |
868 | - if (! $schema->hasTable($foreignKey->getForeignTableName())) { |
|
868 | + if ( ! $schema->hasTable($foreignKey->getForeignTableName())) { |
|
869 | 869 | continue; |
870 | 870 | } |
871 | 871 | |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | |
887 | 887 | foreach ($schema->getTables() as $table) { |
888 | 888 | /** @var $sequence Table */ |
889 | - if (! $table->hasPrimaryKey()) { |
|
889 | + if ( ! $table->hasPrimaryKey()) { |
|
890 | 890 | continue; |
891 | 891 | } |
892 | 892 | |
@@ -895,8 +895,8 @@ discard block |
||
895 | 895 | continue; |
896 | 896 | } |
897 | 897 | |
898 | - $checkSequence = $table->getName() . '_' . $columns[0] . '_seq'; |
|
899 | - if (! $fullSchema->hasSequence($checkSequence)) { |
|
898 | + $checkSequence = $table->getName().'_'.$columns[0].'_seq'; |
|
899 | + if ( ! $fullSchema->hasSequence($checkSequence)) { |
|
900 | 900 | continue; |
901 | 901 | } |
902 | 902 |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | // It's a joined result |
86 | 86 | |
87 | 87 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
88 | - $path = $parent . '.' . $dqlAlias; |
|
88 | + $path = $parent.'.'.$dqlAlias; |
|
89 | 89 | |
90 | 90 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
91 | - if (! isset($nonemptyComponents[$parent])) { |
|
91 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
92 | 92 | continue; |
93 | 93 | } |
94 | 94 | |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
98 | 98 | $first = reset($this->resultPointers); |
99 | 99 | // TODO: Exception if $key === null ? |
100 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
100 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
101 | 101 | } elseif (isset($this->resultPointers[$parent])) { |
102 | - $baseElement =& $this->resultPointers[$parent]; |
|
102 | + $baseElement = & $this->resultPointers[$parent]; |
|
103 | 103 | } else { |
104 | 104 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
105 | 105 | |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | $relation = $parentClass->getProperty($relationAlias); |
112 | 112 | |
113 | 113 | // Check the type of the relation (many or single-valued) |
114 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
114 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
115 | 115 | $oneToOne = false; |
116 | 116 | |
117 | - if (! isset($baseElement[$relationAlias])) { |
|
117 | + if ( ! isset($baseElement[$relationAlias])) { |
|
118 | 118 | $baseElement[$relationAlias] = []; |
119 | 119 | } |
120 | 120 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $index = $indexExists ? $this->identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false; |
124 | 124 | $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false; |
125 | 125 | |
126 | - if (! $indexExists || ! $indexIsValid) { |
|
126 | + if ( ! $indexExists || ! $indexIsValid) { |
|
127 | 127 | $element = $data; |
128 | 128 | |
129 | 129 | if (isset($this->rsm->indexByMap[$dqlAlias])) { |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | ( ! isset($baseElement[$relationAlias])) |
145 | 145 | ) { |
146 | 146 | $baseElement[$relationAlias] = null; |
147 | - } elseif (! isset($baseElement[$relationAlias])) { |
|
147 | + } elseif ( ! isset($baseElement[$relationAlias])) { |
|
148 | 148 | $baseElement[$relationAlias] = $data; |
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | - $coll =& $baseElement[$relationAlias]; |
|
152 | + $coll = & $baseElement[$relationAlias]; |
|
153 | 153 | |
154 | 154 | if (is_array($coll)) { |
155 | 155 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
162 | 162 | |
163 | 163 | // if this row has a NULL value for the root result id then make it a null result. |
164 | - if (! isset($nonemptyComponents[$dqlAlias])) { |
|
164 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
165 | 165 | $result[] = $this->rsm->isMixed |
166 | 166 | ? [$entityKey => null] |
167 | 167 | : null; |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
201 | - if (! isset($resultKey)) { |
|
201 | + if ( ! isset($resultKey)) { |
|
202 | 202 | $this->resultCounter++; |
203 | 203 | } |
204 | 204 | |
205 | 205 | // Append scalar values to mixed result sets |
206 | 206 | if (isset($rowData['scalars'])) { |
207 | - if (! isset($resultKey)) { |
|
207 | + if ( ! isset($resultKey)) { |
|
208 | 208 | // this only ever happens when no object is fetched (scalar result only) |
209 | 209 | $resultKey = isset($this->rsm->indexByMap['scalars']) |
210 | 210 | ? $row[$this->rsm->indexByMap['scalars']] |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | // Append new object to mixed result sets |
220 | - if (! isset($rowData['newObjects'])) { |
|
220 | + if ( ! isset($rowData['newObjects'])) { |
|
221 | 221 | return; |
222 | 222 | } |
223 | 223 | |
224 | - if (! isset($resultKey)) { |
|
224 | + if ( ! isset($resultKey)) { |
|
225 | 225 | $resultKey = $this->resultCounter - 1; |
226 | 226 | } |
227 | 227 | |
@@ -262,22 +262,22 @@ discard block |
||
262 | 262 | } |
263 | 263 | |
264 | 264 | if ($oneToOne) { |
265 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
265 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
266 | 266 | |
267 | 267 | return; |
268 | 268 | } |
269 | 269 | |
270 | 270 | if ($index !== false) { |
271 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
271 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
272 | 272 | |
273 | 273 | return; |
274 | 274 | } |
275 | 275 | |
276 | - if (! $coll) { |
|
276 | + if ( ! $coll) { |
|
277 | 277 | return; |
278 | 278 | } |
279 | 279 | |
280 | 280 | end($coll); |
281 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
281 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
282 | 282 | } |
283 | 283 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $discrColumnName = $metaMappingDiscrColumnName; |
84 | 84 | } |
85 | 85 | |
86 | - if (! isset($sqlResult[$discrColumnName])) { |
|
86 | + if ( ! isset($sqlResult[$discrColumnName])) { |
|
87 | 87 | throw HydrationException::missingDiscriminatorColumn($entityName, $discrColumnName, key($this->rsm->aliasMap)); |
88 | 88 | } |
89 | 89 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $discrMap = $this->class->discriminatorMap; |
95 | 95 | |
96 | - if (! isset($discrMap[$sqlResult[$discrColumnName]])) { |
|
96 | + if ( ! isset($discrMap[$sqlResult[$discrColumnName]])) { |
|
97 | 97 | throw HydrationException::invalidDiscriminatorValue($sqlResult[$discrColumnName], array_keys($discrMap)); |
98 | 98 | } |
99 | 99 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $cacheKeyInfo = $this->hydrateColumnInfo($column); |
112 | 112 | |
113 | - if (! $cacheKeyInfo) { |
|
113 | + if ( ! $cacheKeyInfo) { |
|
114 | 114 | continue; |
115 | 115 | } |
116 | 116 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $result[] = $entity; |
140 | 140 | |
141 | - if (! isset($this->hints[Query::HINT_INTERNAL_ITERATION]) || ! $this->hints[Query::HINT_INTERNAL_ITERATION]) { |
|
141 | + if ( ! isset($this->hints[Query::HINT_INTERNAL_ITERATION]) || ! $this->hints[Query::HINT_INTERNAL_ITERATION]) { |
|
142 | 142 | return; |
143 | 143 | } |
144 | 144 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | protected function prepare() |
55 | 55 | { |
56 | - if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
56 | + if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
57 | 57 | $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true; |
58 | 58 | } |
59 | 59 | |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | |
64 | 64 | // Remember which associations are "fetch joined", so that we know where to inject |
65 | 65 | // collection stubs or proxies and where not. |
66 | - if (! isset($this->rsm->relationMap[$dqlAlias])) { |
|
66 | + if ( ! isset($this->rsm->relationMap[$dqlAlias])) { |
|
67 | 67 | continue; |
68 | 68 | } |
69 | 69 | |
70 | 70 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
71 | 71 | |
72 | - if (! isset($this->rsm->aliasMap[$parent])) { |
|
72 | + if ( ! isset($this->rsm->aliasMap[$parent])) { |
|
73 | 73 | throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent); |
74 | 74 | } |
75 | 75 | |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | // handle fetch-joined owning side bi-directional one-to-one associations |
94 | - if (! $association->getInversedBy()) { |
|
94 | + if ( ! $association->getInversedBy()) { |
|
95 | 95 | continue; |
96 | 96 | } |
97 | 97 | |
98 | 98 | $class = $this->getClassMetadata($className); |
99 | 99 | $inverseAssoc = $class->getProperty($association->getInversedBy()); |
100 | 100 | |
101 | - if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
101 | + if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
102 | 102 | continue; |
103 | 103 | } |
104 | 104 | |
@@ -163,14 +163,14 @@ discard block |
||
163 | 163 | $value = $association->getValue($entity); |
164 | 164 | $oid = spl_object_id($entity); |
165 | 165 | |
166 | - if (! $value instanceof PersistentCollection) { |
|
166 | + if ( ! $value instanceof PersistentCollection) { |
|
167 | 167 | $value = $association->wrap($entity, $value, $this->em); |
168 | 168 | |
169 | 169 | $association->setValue($entity, $value); |
170 | 170 | |
171 | 171 | $this->uow->setOriginalEntityProperty($oid, $fieldName, $value); |
172 | 172 | |
173 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
173 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
174 | 174 | } elseif (isset($this->hints[Query::HINT_REFRESH]) || |
175 | 175 | (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized()) |
176 | 176 | ) { |
@@ -179,10 +179,10 @@ discard block |
||
179 | 179 | $value->setInitialized(true); |
180 | 180 | $value->unwrap()->clear(); |
181 | 181 | |
182 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
182 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
183 | 183 | } else { |
184 | 184 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
185 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
185 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | return $value; |
@@ -205,13 +205,13 @@ discard block |
||
205 | 205 | if (isset($this->rsm->discriminatorColumns[$dqlAlias])) { |
206 | 206 | $fieldName = $this->rsm->discriminatorColumns[$dqlAlias]; |
207 | 207 | |
208 | - if (! isset($this->rsm->metaMappings[$fieldName])) { |
|
208 | + if ( ! isset($this->rsm->metaMappings[$fieldName])) { |
|
209 | 209 | throw HydrationException::missingDiscriminatorMetaMappingColumn($className, $fieldName, $dqlAlias); |
210 | 210 | } |
211 | 211 | |
212 | 212 | $discrColumn = $this->rsm->metaMappings[$fieldName]; |
213 | 213 | |
214 | - if (! isset($data[$discrColumn])) { |
|
214 | + if ( ! isset($data[$discrColumn])) { |
|
215 | 215 | throw HydrationException::missingDiscriminatorColumn($className, $discrColumn, $dqlAlias); |
216 | 216 | } |
217 | 217 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $discrMap = $this->metadataCache[$className]->discriminatorMap; |
223 | 223 | $discriminatorValue = (string) $data[$discrColumn]; |
224 | 224 | |
225 | - if (! isset($discrMap[$discriminatorValue])) { |
|
225 | + if ( ! isset($discrMap[$discriminatorValue])) { |
|
226 | 226 | throw HydrationException::invalidDiscriminatorValue($discriminatorValue, array_keys($discrMap)); |
227 | 227 | } |
228 | 228 | |
@@ -298,10 +298,10 @@ discard block |
||
298 | 298 | $parentAlias = $this->rsm->parentAliasMap[$dqlAlias]; |
299 | 299 | // we need the $path to save into the identifier map which entities were already |
300 | 300 | // seen for this parent-child relationship |
301 | - $path = $parentAlias . '.' . $dqlAlias; |
|
301 | + $path = $parentAlias.'.'.$dqlAlias; |
|
302 | 302 | |
303 | 303 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
304 | - if (! isset($nonemptyComponents[$parentAlias])) { |
|
304 | + if ( ! isset($nonemptyComponents[$parentAlias])) { |
|
305 | 305 | // TODO: Add special case code where we hydrate the right join objects into identity map at least |
306 | 306 | continue; |
307 | 307 | } |
@@ -332,15 +332,15 @@ discard block |
||
332 | 332 | $oid = spl_object_id($parentObject); |
333 | 333 | |
334 | 334 | // Check the type of the relation (many or single-valued) |
335 | - if (! ($association instanceof ToOneAssociationMetadata)) { |
|
335 | + if ( ! ($association instanceof ToOneAssociationMetadata)) { |
|
336 | 336 | // PATH A: Collection-valued association |
337 | 337 | $reflFieldValue = $association->getValue($parentObject); |
338 | 338 | |
339 | 339 | if (isset($nonemptyComponents[$dqlAlias])) { |
340 | - $collKey = $oid . $relationField; |
|
340 | + $collKey = $oid.$relationField; |
|
341 | 341 | if (isset($this->initializedCollections[$collKey])) { |
342 | 342 | $reflFieldValue = $this->initializedCollections[$collKey]; |
343 | - } elseif (! isset($this->existingCollections[$collKey])) { |
|
343 | + } elseif ( ! isset($this->existingCollections[$collKey])) { |
|
344 | 344 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
345 | 345 | } |
346 | 346 | |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $index = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false; |
349 | 349 | $indexIsValid = $index !== false ? isset($reflFieldValue[$index]) : false; |
350 | 350 | |
351 | - if (! $indexExists || ! $indexIsValid) { |
|
351 | + if ( ! $indexExists || ! $indexIsValid) { |
|
352 | 352 | if (isset($this->existingCollections[$collKey])) { |
353 | 353 | $element = $this->getEntityFromIdentityMap($entityName, $data); |
354 | 354 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | // Update result pointer |
378 | 378 | $this->resultPointers[$dqlAlias] = $reflFieldValue[$index]; |
379 | 379 | } |
380 | - } elseif (! $reflFieldValue) { |
|
380 | + } elseif ( ! $reflFieldValue) { |
|
381 | 381 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
382 | 382 | } elseif ($reflFieldValue instanceof PersistentCollection && $reflFieldValue->isInitialized() === false) { |
383 | 383 | $reflFieldValue->setInitialized(true); |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | // PATH B: Single-valued association |
387 | 387 | $reflFieldValue = $association->getValue($parentObject); |
388 | 388 | |
389 | - if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
389 | + if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
390 | 390 | ($reflFieldValue instanceof GhostObjectInterface && ! $reflFieldValue->isProxyInitialized())) { |
391 | 391 | // we only need to take action if this value is null, |
392 | 392 | // we refresh the entity or its an uninitialized proxy. |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
448 | 448 | |
449 | 449 | // if this row has a NULL value for the root result id then make it a null result. |
450 | - if (! isset($nonemptyComponents[$dqlAlias])) { |
|
450 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
451 | 451 | if ($this->rsm->isMixed) { |
452 | 452 | $result[] = [$entityKey => null]; |
453 | 453 | } else { |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | } |
460 | 460 | |
461 | 461 | // check for existing result from the iterations before |
462 | - if (! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) { |
|
462 | + if ( ! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) { |
|
463 | 463 | $element = $this->getEntity($data, $dqlAlias); |
464 | 464 | |
465 | 465 | if ($this->rsm->isMixed) { |
@@ -497,20 +497,20 @@ discard block |
||
497 | 497 | } |
498 | 498 | } |
499 | 499 | |
500 | - if (! isset($this->hints[Query::HINT_INTERNAL_ITERATION]) || ! $this->hints[Query::HINT_INTERNAL_ITERATION]) { |
|
500 | + if ( ! isset($this->hints[Query::HINT_INTERNAL_ITERATION]) || ! $this->hints[Query::HINT_INTERNAL_ITERATION]) { |
|
501 | 501 | continue; |
502 | 502 | } |
503 | 503 | |
504 | 504 | $this->uow->hydrationComplete(); |
505 | 505 | } |
506 | 506 | |
507 | - if (! isset($resultKey)) { |
|
507 | + if ( ! isset($resultKey)) { |
|
508 | 508 | $this->resultCounter++; |
509 | 509 | } |
510 | 510 | |
511 | 511 | // Append scalar values to mixed result sets |
512 | 512 | if (isset($rowData['scalars'])) { |
513 | - if (! isset($resultKey)) { |
|
513 | + if ( ! isset($resultKey)) { |
|
514 | 514 | $resultKey = (isset($this->rsm->indexByMap['scalars'])) |
515 | 515 | ? $row[$this->rsm->indexByMap['scalars']] |
516 | 516 | : $this->resultCounter - 1; |
@@ -522,11 +522,11 @@ discard block |
||
522 | 522 | } |
523 | 523 | |
524 | 524 | // Append new object to mixed result sets |
525 | - if (! isset($rowData['newObjects'])) { |
|
525 | + if ( ! isset($rowData['newObjects'])) { |
|
526 | 526 | return; |
527 | 527 | } |
528 | 528 | |
529 | - if (! isset($resultKey)) { |
|
529 | + if ( ! isset($resultKey)) { |
|
530 | 530 | $resultKey = $this->resultCounter - 1; |
531 | 531 | } |
532 | 532 |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $this->hints = $em->getConfiguration()->getDefaultQueryHints(); |
149 | 149 | $this->hasCache = $this->em->getConfiguration()->isSecondLevelCacheEnabled(); |
150 | 150 | |
151 | - if (! $this->hasCache) { |
|
151 | + if ( ! $this->hasCache) { |
|
152 | 152 | return; |
153 | 153 | } |
154 | 154 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | public function getParameter($key) |
303 | 303 | { |
304 | 304 | $filteredParameters = $this->parameters->filter( |
305 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
305 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
306 | 306 | $parameterName = $parameter->getName(); |
307 | 307 | |
308 | 308 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | return null; |
719 | 719 | } |
720 | 720 | |
721 | - if (! is_array($result)) { |
|
721 | + if ( ! is_array($result)) { |
|
722 | 722 | return $result; |
723 | 723 | } |
724 | 724 | |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | throw new NoResultException(); |
753 | 753 | } |
754 | 754 | |
755 | - if (! is_array($result)) { |
|
755 | + if ( ! is_array($result)) { |
|
756 | 756 | return $result; |
757 | 757 | } |
758 | 758 | |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | $this->setHydrationMode($hydrationMode); |
843 | 843 | } |
844 | 844 | |
845 | - if (! empty($parameters)) { |
|
845 | + if ( ! empty($parameters)) { |
|
846 | 846 | $this->setParameters($parameters); |
847 | 847 | } |
848 | 848 | |
@@ -881,11 +881,11 @@ discard block |
||
881 | 881 | $this->setHydrationMode($hydrationMode); |
882 | 882 | } |
883 | 883 | |
884 | - if (! empty($parameters)) { |
|
884 | + if ( ! empty($parameters)) { |
|
885 | 885 | $this->setParameters($parameters); |
886 | 886 | } |
887 | 887 | |
888 | - $setCacheEntry = function () { |
|
888 | + $setCacheEntry = function() { |
|
889 | 889 | }; |
890 | 890 | |
891 | 891 | if ($this->hydrationCacheProfile !== null) { |
@@ -899,11 +899,11 @@ discard block |
||
899 | 899 | return $result[$realCacheKey]; |
900 | 900 | } |
901 | 901 | |
902 | - if (! $result) { |
|
902 | + if ( ! $result) { |
|
903 | 903 | $result = []; |
904 | 904 | } |
905 | 905 | |
906 | - $setCacheEntry = function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
906 | + $setCacheEntry = function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
907 | 907 | $result[$realCacheKey] = $data; |
908 | 908 | |
909 | 909 | $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | { |
1066 | 1066 | $query = $this->getSQL(); |
1067 | 1067 | $hints = $this->getHints(); |
1068 | - $params = array_map(function (Parameter $parameter) { |
|
1068 | + $params = array_map(function(Parameter $parameter) { |
|
1069 | 1069 | $value = $parameter->getValue(); |
1070 | 1070 | |
1071 | 1071 | // Small optimization |
@@ -1079,6 +1079,6 @@ discard block |
||
1079 | 1079 | |
1080 | 1080 | ksort($hints); |
1081 | 1081 | |
1082 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1082 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1083 | 1083 | } |
1084 | 1084 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | // If _backRefFieldName is set and its a one-to-many association, |
152 | 152 | // we need to set the back reference. |
153 | - if (! $this->backRefFieldName || ! ($this->association instanceof OneToManyAssociationMetadata)) { |
|
153 | + if ( ! $this->backRefFieldName || ! ($this->association instanceof OneToManyAssociationMetadata)) { |
|
154 | 154 | return; |
155 | 155 | } |
156 | 156 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | // If _backRefFieldName is set, then the association is bidirectional |
181 | 181 | // and we need to set the back reference. |
182 | - if (! $this->backRefFieldName || ! ($this->association instanceof OneToManyAssociationMetadata)) { |
|
182 | + if ( ! $this->backRefFieldName || ! ($this->association instanceof OneToManyAssociationMetadata)) { |
|
183 | 183 | return; |
184 | 184 | } |
185 | 185 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | $this->isDirty = true; |
286 | 286 | |
287 | - if (! ($this->association instanceof ManyToManyAssociationMetadata) || |
|
287 | + if ( ! ($this->association instanceof ManyToManyAssociationMetadata) || |
|
288 | 288 | ! $this->owner || |
289 | 289 | ! $this->association->isOwningSide() || |
290 | 290 | $this->em->getClassMetadata(get_class($this->owner))->changeTrackingPolicy !== ChangeTrackingPolicy::NOTIFY) { |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | // association (table). Without initializing the collection. |
337 | 337 | $removed = parent::remove($key); |
338 | 338 | |
339 | - if (! $removed) { |
|
339 | + if ( ! $removed) { |
|
340 | 340 | return $removed; |
341 | 341 | } |
342 | 342 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function removeElement($element) |
359 | 359 | { |
360 | - if (! $this->initialized && |
|
360 | + if ( ! $this->initialized && |
|
361 | 361 | $this->association !== null && |
362 | 362 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
363 | 363 | if ($this->collection->contains($element)) { |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | |
372 | 372 | $removed = parent::removeElement($element); |
373 | 373 | |
374 | - if (! $removed) { |
|
374 | + if ( ! $removed) { |
|
375 | 375 | return $removed; |
376 | 376 | } |
377 | 377 | |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | */ |
393 | 393 | public function containsKey($key) |
394 | 394 | { |
395 | - if (! $this->initialized && |
|
395 | + if ( ! $this->initialized && |
|
396 | 396 | $this->association !== null && |
397 | 397 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
398 | 398 | $this->association->getIndexedBy()) { |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | */ |
410 | 410 | public function contains($element) |
411 | 411 | { |
412 | - if (! $this->initialized && |
|
412 | + if ( ! $this->initialized && |
|
413 | 413 | $this->association !== null && |
414 | 414 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
415 | 415 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -425,11 +425,11 @@ discard block |
||
425 | 425 | */ |
426 | 426 | public function get($key) |
427 | 427 | { |
428 | - if (! $this->initialized && |
|
428 | + if ( ! $this->initialized && |
|
429 | 429 | $this->association !== null && |
430 | 430 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
431 | 431 | $this->association->getIndexedBy()) { |
432 | - if (! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
432 | + if ( ! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
433 | 433 | return $this->em->find($this->typeClass->getClassName(), $key); |
434 | 434 | } |
435 | 435 | |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | */ |
445 | 445 | public function count() |
446 | 446 | { |
447 | - if (! $this->initialized && |
|
447 | + if ( ! $this->initialized && |
|
448 | 448 | $this->association !== null && |
449 | 449 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
450 | 450 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | |
465 | 465 | $this->changed(); |
466 | 466 | |
467 | - if (! is_object($value) || ! $this->em) { |
|
467 | + if ( ! is_object($value) || ! $this->em) { |
|
468 | 468 | return; |
469 | 469 | } |
470 | 470 | |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | */ |
511 | 511 | public function offsetSet($offset, $value) |
512 | 512 | { |
513 | - if (! isset($offset)) { |
|
513 | + if ( ! isset($offset)) { |
|
514 | 514 | $this->add($value); |
515 | 515 | return; |
516 | 516 | } |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | |
568 | 568 | $this->initialized = true; // direct call, {@link initialize()} is too expensive |
569 | 569 | |
570 | - if (! $this->association->isOwningSide() || ! $this->owner) { |
|
570 | + if ( ! $this->association->isOwningSide() || ! $this->owner) { |
|
571 | 571 | return; |
572 | 572 | } |
573 | 573 | |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | */ |
607 | 607 | public function slice($offset, $length = null) |
608 | 608 | { |
609 | - if (! $this->initialized && |
|
609 | + if ( ! $this->initialized && |
|
610 | 610 | ! $this->isDirty && |
611 | 611 | $this->association !== null && |
612 | 612 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | $this->em->getUnitOfWork()->loadCollection($this); |
709 | 709 | $this->takeSnapshot(); |
710 | 710 | |
711 | - if (! $newlyAddedDirtyObjects) { |
|
711 | + if ( ! $newlyAddedDirtyObjects) { |
|
712 | 712 | return; |
713 | 713 | } |
714 | 714 | |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | $loadedObjectsByOid = array_combine(array_map('spl_object_id', $loadedObjects), $loadedObjects); |
731 | 731 | $newObjectsThatWereNotLoaded = array_diff_key($newObjectsByOid, $loadedObjectsByOid); |
732 | 732 | |
733 | - if (! $newObjectsThatWereNotLoaded) { |
|
733 | + if ( ! $newObjectsThatWereNotLoaded) { |
|
734 | 734 | return; |
735 | 735 | } |
736 | 736 |