@@ -99,7 +99,7 @@ |
||
99 | 99 | assert($this->fieldName !== null); |
100 | 100 | assert($this->fieldType !== null); |
101 | 101 | |
102 | - if (! $this->generatedValueAnnotation) { |
|
102 | + if ( ! $this->generatedValueAnnotation) { |
|
103 | 103 | return null; |
104 | 104 | } |
105 | 105 |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function isTransient($className) : bool |
132 | 132 | { |
133 | - if (! $this->initialized) { |
|
133 | + if ( ! $this->initialized) { |
|
134 | 134 | $this->initialize(); |
135 | 135 | } |
136 | 136 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function getAllMetadata() : array |
180 | 180 | { |
181 | - if (! $this->initialized) { |
|
181 | + if ( ! $this->initialized) { |
|
182 | 182 | $this->initialize(); |
183 | 183 | } |
184 | 184 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | public function getTargetPlatform() : Platforms\AbstractPlatform |
216 | 216 | { |
217 | - if (! $this->targetPlatform) { |
|
217 | + if ( ! $this->targetPlatform) { |
|
218 | 218 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
219 | 219 | } |
220 | 220 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | try { |
258 | 258 | if ($this->cacheDriver) { |
259 | - $cached = $this->cacheDriver->fetch($entityClassName . $this->cacheSalt); |
|
259 | + $cached = $this->cacheDriver->fetch($entityClassName.$this->cacheSalt); |
|
260 | 260 | |
261 | 261 | if ($cached instanceof ClassMetadata) { |
262 | 262 | $this->loadedMetadata[$entityClassName] = $cached; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | foreach ($this->loadMetadata($entityClassName, $metadataBuildingContext) as $loadedClass) { |
267 | 267 | $loadedClassName = $loadedClass->getClassName(); |
268 | 268 | |
269 | - $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, null); |
|
269 | + $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, null); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | } else { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } catch (PersistenceMappingException $loadingException) { |
276 | 276 | $fallbackMetadataResponse = $this->onNotFoundMetadata($entityClassName, $metadataBuildingContext); |
277 | 277 | |
278 | - if (! $fallbackMetadataResponse) { |
|
278 | + if ( ! $fallbackMetadataResponse) { |
|
279 | 279 | throw $loadingException; |
280 | 280 | } |
281 | 281 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | protected function loadMetadata(string $name, ClassMetadataBuildingContext $metadataBuildingContext) : array |
313 | 313 | { |
314 | - if (! $this->initialized) { |
|
314 | + if ( ! $this->initialized) { |
|
315 | 315 | $this->initialize(); |
316 | 316 | } |
317 | 317 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $parentClasses = []; |
358 | 358 | |
359 | 359 | foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { |
360 | - if (! $this->getDriver()->isTransient($parentClass)) { |
|
360 | + if ( ! $this->getDriver()->isTransient($parentClass)) { |
|
361 | 361 | $parentClasses[] = $parentClass; |
362 | 362 | } |
363 | 363 | } |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | string $className, |
373 | 373 | ClassMetadataBuildingContext $metadataBuildingContext |
374 | 374 | ) : ?ClassMetadata { |
375 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
375 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
376 | 376 | return null; |
377 | 377 | } |
378 | 378 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | */ |
417 | 417 | protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
418 | 418 | { |
419 | - if (! $class->getReflectionClass()) { |
|
419 | + if ( ! $class->getReflectionClass()) { |
|
420 | 420 | // only validate if there is a reflection class instance |
421 | 421 | return; |
422 | 422 | } |
@@ -426,13 +426,13 @@ discard block |
||
426 | 426 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
427 | 427 | |
428 | 428 | // verify inheritance |
429 | - if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
430 | - if (! $parent) { |
|
431 | - if (! $class->discriminatorMap) { |
|
429 | + if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
430 | + if ( ! $parent) { |
|
431 | + if ( ! $class->discriminatorMap) { |
|
432 | 432 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
433 | 433 | } |
434 | 434 | |
435 | - if (! $class->discriminatorColumn) { |
|
435 | + if ( ! $class->discriminatorColumn) { |
|
436 | 436 | throw MappingException::missingDiscriminatorColumn($class->getClassName()); |
437 | 437 | } |
438 | 438 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $this->allocationSize |
59 | 59 | ); |
60 | 60 | |
61 | - if ($conn->executeUpdate($updateSql, [1 => $currentLevel, 2 => $currentLevel+1]) !== 1) { |
|
61 | + if ($conn->executeUpdate($updateSql, [1 => $currentLevel, 2 => $currentLevel + 1]) !== 1) { |
|
62 | 62 | // no affected rows, concurrency issue, throw exception |
63 | 63 | } |
64 | 64 | } else { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | { |
157 | 157 | $this->addresses = $addresses; |
158 | 158 | |
159 | - $addresses->map(function ($address) { |
|
159 | + $addresses->map(function($address) { |
|
160 | 160 | $address->user = $this; |
161 | 161 | }); |
162 | 162 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | { |
166 | 166 | $this->pets = $pets; |
167 | 167 | |
168 | - $pets->map(function ($pet) { |
|
168 | + $pets->map(function($pet) { |
|
169 | 169 | $pet->owner = $this; |
170 | 170 | }); |
171 | 171 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | ); |
84 | 84 | } |
85 | 85 | |
86 | - if (! $associationMetadata->isOwningSide()) { |
|
86 | + if ( ! $associationMetadata->isOwningSide()) { |
|
87 | 87 | throw Mapping\MappingException::illegalInverseIdentifierAssociation( |
88 | 88 | $this->componentMetadata->getClassName(), |
89 | 89 | $this->fieldName |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | // @todo guilhermeblanco The below block of code modifies component metadata properties, and it should be moved |
101 | 101 | // to the component metadata builder instead of here. |
102 | 102 | |
103 | - if (! in_array($this->fieldName, $this->componentMetadata->identifier, true)) { |
|
103 | + if ( ! in_array($this->fieldName, $this->componentMetadata->identifier, true)) { |
|
104 | 104 | $this->componentMetadata->identifier[] = $this->fieldName; |
105 | 105 | } |
106 | 106 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $associationMetadata->setOwningSide(false); |
47 | 47 | $associationMetadata->setMappedBy($this->oneToManyAnnotation->mappedBy); |
48 | 48 | |
49 | - if (! empty($this->oneToManyAnnotation->indexBy)) { |
|
49 | + if ( ! empty($this->oneToManyAnnotation->indexBy)) { |
|
50 | 50 | $associationMetadata->setIndexedBy($this->oneToManyAnnotation->indexBy); |
51 | 51 | } |
52 | 52 |
@@ -86,16 +86,16 @@ discard block |
||
86 | 86 | $associationMetadata->setFetchMode($this->getFetchMode($this->manyToManyAnnotation->fetch)); |
87 | 87 | $associationMetadata->setOwningSide(true); |
88 | 88 | |
89 | - if (! empty($this->manyToManyAnnotation->mappedBy)) { |
|
89 | + if ( ! empty($this->manyToManyAnnotation->mappedBy)) { |
|
90 | 90 | $associationMetadata->setMappedBy($this->manyToManyAnnotation->mappedBy); |
91 | 91 | $associationMetadata->setOwningSide(false); |
92 | 92 | } |
93 | 93 | |
94 | - if (! empty($this->manyToManyAnnotation->inversedBy)) { |
|
94 | + if ( ! empty($this->manyToManyAnnotation->inversedBy)) { |
|
95 | 95 | $associationMetadata->setInversedBy($this->manyToManyAnnotation->inversedBy); |
96 | 96 | } |
97 | 97 | |
98 | - if (! empty($this->manyToManyAnnotation->indexBy)) { |
|
98 | + if ( ! empty($this->manyToManyAnnotation->indexBy)) { |
|
99 | 99 | $associationMetadata->setIndexedBy($this->manyToManyAnnotation->indexBy); |
100 | 100 | } |
101 | 101 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $this->buildCache($associationMetadata); |
114 | 114 | |
115 | 115 | // Check for owning side to consider join column |
116 | - if (! $associationMetadata->isOwningSide()) { |
|
116 | + if ( ! $associationMetadata->isOwningSide()) { |
|
117 | 117 | return $associationMetadata; |
118 | 118 | } |
119 | 119 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $associationMetadata->setFetchMode($this->getFetchMode($this->manyToOneAnnotation->fetch)); |
42 | 42 | $associationMetadata->setOwningSide(true); |
43 | 43 | |
44 | - if (! empty($this->manyToOneAnnotation->inversedBy)) { |
|
44 | + if ( ! empty($this->manyToOneAnnotation->inversedBy)) { |
|
45 | 45 | $associationMetadata->setInversedBy($this->manyToOneAnnotation->inversedBy); |
46 | 46 | } |
47 | 47 |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | $associationMetadata->setCascade(array_unique(array_merge($associationMetadata->getCascade(), ['remove']))); |
52 | 52 | } |
53 | 53 | |
54 | - if (! empty($this->oneToOneAnnotation->mappedBy)) { |
|
54 | + if ( ! empty($this->oneToOneAnnotation->mappedBy)) { |
|
55 | 55 | $associationMetadata->setMappedBy($this->oneToOneAnnotation->mappedBy); |
56 | 56 | $associationMetadata->setOwningSide(false); |
57 | 57 | } |
58 | 58 | |
59 | - if (! empty($this->oneToOneAnnotation->inversedBy)) { |
|
59 | + if ( ! empty($this->oneToOneAnnotation->inversedBy)) { |
|
60 | 60 | $associationMetadata->setInversedBy($this->oneToOneAnnotation->inversedBy); |
61 | 61 | $associationMetadata->setOwningSide(true); |
62 | 62 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $this->buildPrimaryKey($associationMetadata); |
66 | 66 | |
67 | 67 | // Check for owning side to consider join column |
68 | - if (! $associationMetadata->isOwningSide()) { |
|
68 | + if ( ! $associationMetadata->isOwningSide()) { |
|
69 | 69 | return $associationMetadata; |
70 | 70 | } |
71 | 71 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if (count($joinColumns) === 1) { |
90 | 90 | $joinColumn = reset($joinColumns); |
91 | 91 | |
92 | - if (! $associationMetadata->isPrimaryKey()) { |
|
92 | + if ( ! $associationMetadata->isPrimaryKey()) { |
|
93 | 93 | $joinColumn->setUnique(true); |
94 | 94 | } |
95 | 95 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $tableMetadata = $this->componentMetadata->table; |
100 | 100 | |
101 | - if (! $tableMetadata) { |
|
101 | + if ( ! $tableMetadata) { |
|
102 | 102 | $exception = 'ClassMetadata::setTable() has to be called before defining a one to one relationship.'; |
103 | 103 | |
104 | 104 | throw new RuntimeException($exception); |