@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function isTransient($className) : bool |
128 | 128 | { |
129 | - if (! $this->initialized) { |
|
129 | + if ( ! $this->initialized) { |
|
130 | 130 | $this->initialize(); |
131 | 131 | } |
132 | 132 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function getAllMetadata() : array |
176 | 176 | { |
177 | - if (! $this->initialized) { |
|
177 | + if ( ! $this->initialized) { |
|
178 | 178 | $this->initialize(); |
179 | 179 | } |
180 | 180 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | public function getTargetPlatform() : Platforms\AbstractPlatform |
212 | 212 | { |
213 | - if (! $this->targetPlatform) { |
|
213 | + if ( ! $this->targetPlatform) { |
|
214 | 214 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
215 | 215 | } |
216 | 216 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | |
253 | 253 | try { |
254 | 254 | if ($this->cacheDriver) { |
255 | - $cached = $this->cacheDriver->fetch($entityClassName . $this->cacheSalt); |
|
255 | + $cached = $this->cacheDriver->fetch($entityClassName.$this->cacheSalt); |
|
256 | 256 | |
257 | 257 | if ($cached instanceof ClassMetadata) { |
258 | 258 | $this->loadedMetadata[$entityClassName] = $cached; |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | foreach ($this->loadMetadata($entityClassName, $metadataBuildingContext) as $loadedClass) { |
263 | 263 | $loadedClassName = $loadedClass->getClassName(); |
264 | 264 | |
265 | - $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, null); |
|
265 | + $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, null); |
|
266 | 266 | } |
267 | 267 | } |
268 | 268 | } else { |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } catch (PersistenceMappingException $loadingException) { |
272 | 272 | $fallbackMetadataResponse = $this->onNotFoundMetadata($entityClassName, $metadataBuildingContext); |
273 | 273 | |
274 | - if (! $fallbackMetadataResponse) { |
|
274 | + if ( ! $fallbackMetadataResponse) { |
|
275 | 275 | throw $loadingException; |
276 | 276 | } |
277 | 277 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | protected function loadMetadata(string $name, ClassMetadataBuildingContext $metadataBuildingContext) : array |
309 | 309 | { |
310 | - if (! $this->initialized) { |
|
310 | + if ( ! $this->initialized) { |
|
311 | 311 | $this->initialize(); |
312 | 312 | } |
313 | 313 | |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $parentClasses = []; |
354 | 354 | |
355 | 355 | foreach (\array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { |
356 | - if (! $this->getDriver()->isTransient($parentClass)) { |
|
356 | + if ( ! $this->getDriver()->isTransient($parentClass)) { |
|
357 | 357 | $parentClasses[] = $parentClass; |
358 | 358 | } |
359 | 359 | } |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | string $className, |
369 | 369 | ClassMetadataBuildingContext $metadataBuildingContext |
370 | 370 | ) : ?ClassMetadata { |
371 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
371 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
372 | 372 | return null; |
373 | 373 | } |
374 | 374 | |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | */ |
419 | 419 | protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
420 | 420 | { |
421 | - if (! $class->getReflectionClass()) { |
|
421 | + if ( ! $class->getReflectionClass()) { |
|
422 | 422 | // only validate if there is a reflection class instance |
423 | 423 | return; |
424 | 424 | } |
@@ -427,13 +427,13 @@ discard block |
||
427 | 427 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
428 | 428 | |
429 | 429 | // verify inheritance |
430 | - if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
431 | - if (! $parent) { |
|
432 | - if (! $class->discriminatorMap) { |
|
430 | + if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
431 | + if ( ! $parent) { |
|
432 | + if ( ! $class->discriminatorMap) { |
|
433 | 433 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
434 | 434 | } |
435 | 435 | |
436 | - if (! $class->discriminatorColumn) { |
|
436 | + if ( ! $class->discriminatorColumn) { |
|
437 | 437 | throw MappingException::missingDiscriminatorColumn($class->getClassName()); |
438 | 438 | } |
439 | 439 | } |
@@ -220,11 +220,11 @@ discard block |
||
220 | 220 | $this->setCache(clone $parent->cache); |
221 | 221 | } |
222 | 222 | |
223 | - if (! empty($parent->lifecycleCallbacks)) { |
|
223 | + if ( ! empty($parent->lifecycleCallbacks)) { |
|
224 | 224 | $this->lifecycleCallbacks = $parent->lifecycleCallbacks; |
225 | 225 | } |
226 | 226 | |
227 | - if (! empty($parent->entityListeners)) { |
|
227 | + if ( ! empty($parent->entityListeners)) { |
|
228 | 228 | $this->entityListeners = $parent->entityListeners; |
229 | 229 | } |
230 | 230 | } |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function __toString() |
293 | 293 | { |
294 | - return self::class . '@' . spl_object_id($this); |
|
294 | + return self::class.'@'.spl_object_id($this); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
@@ -387,11 +387,11 @@ discard block |
||
387 | 387 | */ |
388 | 388 | public function isIdentifier(string $fieldName) : bool |
389 | 389 | { |
390 | - if (! $this->identifier) { |
|
390 | + if ( ! $this->identifier) { |
|
391 | 391 | return false; |
392 | 392 | } |
393 | 393 | |
394 | - if (! $this->isIdentifierComposite()) { |
|
394 | + if ( ! $this->isIdentifierComposite()) { |
|
395 | 395 | return $fieldName === $this->identifier[0]; |
396 | 396 | } |
397 | 397 | |
@@ -415,11 +415,11 @@ discard block |
||
415 | 415 | } |
416 | 416 | |
417 | 417 | // Verify & complete identifier mapping |
418 | - if (! $this->identifier) { |
|
418 | + if ( ! $this->identifier) { |
|
419 | 419 | throw MappingException::identifierRequired($this->className); |
420 | 420 | } |
421 | 421 | |
422 | - $explicitlyGeneratedProperties = \array_filter($this->properties, static function (Property $property) : bool { |
|
422 | + $explicitlyGeneratedProperties = \array_filter($this->properties, static function(Property $property) : bool { |
|
423 | 423 | return $property instanceof FieldMetadata |
424 | 424 | && $property->isPrimaryKey() |
425 | 425 | && $property->hasValueGenerator(); |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | foreach ($this->lifecycleCallbacks as $callbacks) { |
441 | 441 | /** @var array $callbacks */ |
442 | 442 | foreach ($callbacks as $callbackFuncName) { |
443 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
443 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
444 | 444 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
445 | 445 | } |
446 | 446 | } |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
470 | 470 | } |
471 | 471 | |
472 | - if (! isset($this->identifier[0])) { |
|
472 | + if ( ! isset($this->identifier[0])) { |
|
473 | 473 | throw MappingException::noIdDefined($this->className); |
474 | 474 | } |
475 | 475 | |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | // Association defined as Id field |
529 | 529 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
530 | 530 | |
531 | - if (! $property->isOwningSide()) { |
|
531 | + if ( ! $property->isOwningSide()) { |
|
532 | 532 | $property = $targetClass->getProperty($property->getMappedBy()); |
533 | 533 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
534 | 534 | } |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | $columnName = $joinColumn->getColumnName(); |
543 | 543 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
544 | 544 | |
545 | - if (! $joinColumn->getType()) { |
|
545 | + if ( ! $joinColumn->getType()) { |
|
546 | 546 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
547 | 547 | } |
548 | 548 | |
@@ -576,10 +576,10 @@ discard block |
||
576 | 576 | { |
577 | 577 | $schema = $this->getSchemaName() === null |
578 | 578 | ? '' |
579 | - : $this->getSchemaName() . '_'; |
|
579 | + : $this->getSchemaName().'_'; |
|
580 | 580 | |
581 | 581 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
582 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
582 | + return $schema.$this->getTableName().'_id_tmp'; |
|
583 | 583 | } |
584 | 584 | |
585 | 585 | /** |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | */ |
614 | 614 | public function setInheritanceType($type) : void |
615 | 615 | { |
616 | - if (! $this->isInheritanceType($type)) { |
|
616 | + if ( ! $this->isInheritanceType($type)) { |
|
617 | 617 | throw MappingException::invalidInheritanceType($this->className, $type); |
618 | 618 | } |
619 | 619 | |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | { |
632 | 632 | $fieldName = $property->getName(); |
633 | 633 | |
634 | - if (! isset($this->properties[$fieldName])) { |
|
634 | + if ( ! isset($this->properties[$fieldName])) { |
|
635 | 635 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
636 | 636 | } |
637 | 637 | |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | $inheritedProperty = $declaringClass->isMappedSuperclass ? clone $property : $property; |
834 | 834 | |
835 | 835 | if ($inheritedProperty instanceof FieldMetadata) { |
836 | - if (! $declaringClass->isMappedSuperclass) { |
|
836 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
837 | 837 | $inheritedProperty->setTableName($property->getTableName()); |
838 | 838 | } |
839 | 839 | |
@@ -926,11 +926,11 @@ discard block |
||
926 | 926 | 'method' => $methodName, |
927 | 927 | ]; |
928 | 928 | |
929 | - if (! \class_exists($class)) { |
|
929 | + if ( ! \class_exists($class)) { |
|
930 | 930 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
931 | 931 | } |
932 | 932 | |
933 | - if (! \method_exists($class, $methodName)) { |
|
933 | + if ( ! \method_exists($class, $methodName)) { |
|
934 | 934 | throw MappingException::entityListenerMethodNotFound($class, $methodName, $this->className); |
935 | 935 | } |
936 | 936 | |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | return; |
999 | 999 | } |
1000 | 1000 | |
1001 | - if (! (\class_exists($className) || \interface_exists($className))) { |
|
1001 | + if ( ! (\class_exists($className) || \interface_exists($className))) { |
|
1002 | 1002 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1003 | 1003 | } |
1004 | 1004 |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | protected function getTargetEntity(string $targetEntity) : string |
91 | 91 | { |
92 | 92 | // Validate if target entity is defined |
93 | - if (! $targetEntity) { |
|
93 | + if ( ! $targetEntity) { |
|
94 | 94 | throw Mapping\MappingException::missingTargetEntity($this->fieldName); |
95 | 95 | } |
96 | 96 | |
97 | 97 | // Validate that target entity exists |
98 | - if (! (\class_exists($targetEntity) || \interface_exists($targetEntity))) { |
|
98 | + if ( ! (\class_exists($targetEntity) || \interface_exists($targetEntity))) { |
|
99 | 99 | throw Mapping\MappingException::invalidTargetEntityClass( |
100 | 100 | $targetEntity, |
101 | 101 | $this->componentMetadata->getClassName(), |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | $fetchModeConstant = \sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
152 | 152 | |
153 | - if (! \defined($fetchModeConstant)) { |
|
153 | + if ( ! \defined($fetchModeConstant)) { |
|
154 | 154 | throw Mapping\MappingException::invalidFetchMode($this->componentMetadata->getClassName(), $fetchMode); |
155 | 155 | } |
156 | 156 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | |
62 | 62 | $componentName = $this->componentMetadata->getRootClassName(); |
63 | 63 | $baseRegion = \strtolower(\str_replace('\\', '_', $componentName)); |
64 | - $defaultRegion = $baseRegion . ($this->fieldName ? '__' . $this->fieldName : ''); |
|
64 | + $defaultRegion = $baseRegion.($this->fieldName ? '__'.$this->fieldName : ''); |
|
65 | 65 | |
66 | 66 | $usage = \constant(\sprintf('%s::%s', Mapping\CacheUsage::class, \strtoupper($this->cacheAnnotation->usage))); |
67 | 67 | $region = $this->cacheAnnotation->region ?: $defaultRegion; |
@@ -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); |
@@ -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 |
@@ -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 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function register($object) |
44 | 44 | { |
45 | - if (! \is_object($object)) { |
|
45 | + if ( ! \is_object($object)) { |
|
46 | 46 | throw new InvalidArgumentException(\sprintf('An object was expected, but got "%s".', \gettype($object))); |
47 | 47 | } |
48 | 48 |
@@ -23,24 +23,24 @@ |
||
23 | 23 | /** @var TableMetadata $value */ |
24 | 24 | $variableExporter = new VariableExporter(); |
25 | 25 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
26 | - $objectReference = $indentation . self::VARIABLE; |
|
26 | + $objectReference = $indentation.self::VARIABLE; |
|
27 | 27 | $lines = []; |
28 | 28 | |
29 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
29 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
30 | 30 | |
31 | - if (! empty($value->getSchema())) { |
|
32 | - $lines[] = $objectReference . '->setSchema("' . $value->getSchema() . '");'; |
|
31 | + if ( ! empty($value->getSchema())) { |
|
32 | + $lines[] = $objectReference.'->setSchema("'.$value->getSchema().'");'; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | foreach ($value->getIndexes() as $index) { |
36 | - $lines[] = $objectReference . '->addIndex(' . \ltrim($variableExporter->export($index, $indentationLevel + 1)) . ');'; |
|
36 | + $lines[] = $objectReference.'->addIndex('.\ltrim($variableExporter->export($index, $indentationLevel + 1)).');'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | foreach ($value->getUniqueConstraints() as $uniqueConstraint) { |
40 | - $lines[] = $objectReference . '->addUniqueConstraint(' . \ltrim($variableExporter->export($uniqueConstraint, $indentationLevel + 1)) . ');'; |
|
40 | + $lines[] = $objectReference.'->addUniqueConstraint('.\ltrim($variableExporter->export($uniqueConstraint, $indentationLevel + 1)).');'; |
|
41 | 41 | } |
42 | 42 | |
43 | - $lines[] = $objectReference . '->setOptions(' . \ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)) . ');'; |
|
43 | + $lines[] = $objectReference.'->setOptions('.\ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)).');'; |
|
44 | 44 | |
45 | 45 | return \implode(PHP_EOL, $lines); |
46 | 46 | } |