@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | protected function onNotFoundMetadata($className) |
| 107 | 107 | { |
| 108 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 108 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 109 | 109 | return; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $this->completeIdGeneratorMapping($class); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if (!$class->isMappedSuperclass) { |
|
| 165 | + if ( ! $class->isMappedSuperclass) { |
|
| 166 | 166 | foreach ($class->embeddedClasses as $property => $embeddableClass) { |
| 167 | 167 | |
| 168 | 168 | if (isset($embeddableClass['inherited'])) { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | $identifier = $embeddableMetadata->getIdentifier(); |
| 189 | 189 | |
| 190 | - if (! empty($identifier)) { |
|
| 190 | + if ( ! empty($identifier)) { |
|
| 191 | 191 | $this->inheritIdGeneratorMapping($class, $embeddableMetadata); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | protected function validateRuntimeMetadata($class, $parent) |
| 259 | 259 | { |
| 260 | - if ( ! $class->reflClass ) { |
|
| 260 | + if ( ! $class->reflClass) { |
|
| 261 | 261 | // only validate if there is a reflection class instance |
| 262 | 262 | return; |
| 263 | 263 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
| 268 | 268 | |
| 269 | 269 | // verify inheritance |
| 270 | - if ( ! $class->isMappedSuperclass && !$class->isInheritanceTypeNone()) { |
|
| 270 | + if ( ! $class->isMappedSuperclass && ! $class->isInheritanceTypeNone()) { |
|
| 271 | 271 | if ( ! $parent) { |
| 272 | 272 | if (count($class->discriminatorMap) == 0) { |
| 273 | 273 | throw MappingException::missingDiscriminatorMap($class->name); |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | { |
| 429 | 429 | foreach ($parentClass->associationMappings as $field => $mapping) { |
| 430 | 430 | if ($parentClass->isMappedSuperclass) { |
| 431 | - if ($mapping['type'] & ClassMetadata::TO_MANY && !$mapping['isOwningSide']) { |
|
| 431 | + if ($mapping['type'] & ClassMetadata::TO_MANY && ! $mapping['isOwningSide']) { |
|
| 432 | 432 | throw MappingException::illegalToManyAssociationOnMappedSuperclass($parentClass->name, $field); |
| 433 | 433 | } |
| 434 | 434 | $mapping['sourceEntity'] = $subClass->name; |
@@ -477,11 +477,11 @@ discard block |
||
| 477 | 477 | |
| 478 | 478 | $parentClass->mapEmbedded( |
| 479 | 479 | [ |
| 480 | - 'fieldName' => $prefix . '.' . $property, |
|
| 480 | + 'fieldName' => $prefix.'.'.$property, |
|
| 481 | 481 | 'class' => $embeddableMetadata->name, |
| 482 | 482 | 'columnPrefix' => $embeddableClass['columnPrefix'], |
| 483 | 483 | 'declaredField' => $embeddableClass['declaredField'] |
| 484 | - ? $prefix . '.' . $embeddableClass['declaredField'] |
|
| 484 | + ? $prefix.'.'.$embeddableClass['declaredField'] |
|
| 485 | 485 | : $prefix, |
| 486 | 486 | 'originalField' => $embeddableClass['originalField'] ?: $property, |
| 487 | 487 | ] |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | */ |
| 500 | 500 | private function addInheritedIndexes(ClassMetadata $subClass, ClassMetadata $parentClass) |
| 501 | 501 | { |
| 502 | - if (! $parentClass->isMappedSuperclass) { |
|
| 502 | + if ( ! $parentClass->isMappedSuperclass) { |
|
| 503 | 503 | return; |
| 504 | 504 | } |
| 505 | 505 | |
@@ -704,14 +704,14 @@ discard block |
||
| 704 | 704 | case ClassMetadata::GENERATOR_TYPE_CUSTOM: |
| 705 | 705 | $definition = $class->customGeneratorDefinition; |
| 706 | 706 | if ( ! class_exists($definition['class'])) { |
| 707 | - throw new ORMException("Can't instantiate custom generator : " . |
|
| 707 | + throw new ORMException("Can't instantiate custom generator : ". |
|
| 708 | 708 | $definition['class']); |
| 709 | 709 | } |
| 710 | 710 | $class->setIdGenerator(new $definition['class']); |
| 711 | 711 | break; |
| 712 | 712 | |
| 713 | 713 | default: |
| 714 | - throw new ORMException("Unknown generator type: " . $class->generatorType); |
|
| 714 | + throw new ORMException("Unknown generator type: ".$class->generatorType); |
|
| 715 | 715 | } |
| 716 | 716 | } |
| 717 | 717 | |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | */ |
| 762 | 762 | protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) |
| 763 | 763 | { |
| 764 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 764 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | /** |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | */ |
| 786 | 786 | private function getTargetPlatform() |
| 787 | 787 | { |
| 788 | - if (!$this->targetPlatform) { |
|
| 788 | + if ( ! $this->targetPlatform) { |
|
| 789 | 789 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
| 790 | 790 | } |
| 791 | 791 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | // Evaluate named native queries |
| 109 | 109 | if (isset($element['namedNativeQueries'])) { |
| 110 | 110 | foreach ($element['namedNativeQueries'] as $name => $mappingElement) { |
| 111 | - if (!isset($mappingElement['name'])) { |
|
| 111 | + if ( ! isset($mappingElement['name'])) { |
|
| 112 | 112 | $mappingElement['name'] = $name; |
| 113 | 113 | } |
| 114 | 114 | $metadata->addNamedNativeQuery( |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | // Evaluate sql result set mappings |
| 126 | 126 | if (isset($element['sqlResultSetMappings'])) { |
| 127 | 127 | foreach ($element['sqlResultSetMappings'] as $name => $resultSetMapping) { |
| 128 | - if (!isset($resultSetMapping['name'])) { |
|
| 128 | + if ( ! isset($resultSetMapping['name'])) { |
|
| 129 | 129 | $resultSetMapping['name'] = $name; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | if (isset($element['inheritanceType'])) { |
| 175 | - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . strtoupper($element['inheritanceType']))); |
|
| 175 | + $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.strtoupper($element['inheritanceType']))); |
|
| 176 | 176 | |
| 177 | 177 | if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) { |
| 178 | 178 | // Evaluate discriminatorColumn |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | if (isset($oneToOneElement['fetch'])) { |
| 364 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToOneElement['fetch']); |
|
| 364 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToOneElement['fetch']); |
|
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | if (isset($oneToOneElement['mappedBy'])) { |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | ]; |
| 416 | 416 | |
| 417 | 417 | if (isset($oneToManyElement['fetch'])) { |
| 418 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToManyElement['fetch']); |
|
| 418 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToManyElement['fetch']); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | if (isset($oneToManyElement['cascade'])) { |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | if (isset($manyToOneElement['fetch'])) { |
| 460 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToOneElement['fetch']); |
|
| 460 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToOneElement['fetch']); |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | if (isset($manyToOneElement['inversedBy'])) { |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | ]; |
| 503 | 503 | |
| 504 | 504 | if (isset($manyToManyElement['fetch'])) { |
| 505 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToManyElement['fetch']); |
|
| 505 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToManyElement['fetch']); |
|
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | if (isset($manyToManyElement['mappedBy'])) { |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | if (isset($element['associationOverride']) && is_array($element['associationOverride'])) { |
| 573 | 573 | |
| 574 | 574 | foreach ($element['associationOverride'] as $fieldName => $associationOverrideElement) { |
| 575 | - $override = []; |
|
| 575 | + $override = []; |
|
| 576 | 576 | |
| 577 | 577 | // Check for joinColumn |
| 578 | 578 | if (isset($associationOverrideElement['joinColumn'])) { |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | if (isset($associationOverrideElement['joinTable'])) { |
| 591 | 591 | |
| 592 | 592 | $joinTableElement = $associationOverrideElement['joinTable']; |
| 593 | - $joinTable = [ |
|
| 593 | + $joinTable = [ |
|
| 594 | 594 | 'name' => $joinTableElement['name'] |
| 595 | 595 | ]; |
| 596 | 596 | |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | if (isset($element['lifecycleCallbacks'])) { |
| 640 | 640 | foreach ($element['lifecycleCallbacks'] as $type => $methods) { |
| 641 | 641 | foreach ($methods as $method) { |
| 642 | - $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::' . $type)); |
|
| 642 | + $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::'.$type)); |
|
| 643 | 643 | } |
| 644 | 644 | } |
| 645 | 645 | } |
@@ -781,12 +781,12 @@ discard block |
||
| 781 | 781 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null; |
| 782 | 782 | $usage = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null; |
| 783 | 783 | |
| 784 | - if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) { |
|
| 784 | + if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) { |
|
| 785 | 785 | throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage)); |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | if ($usage) { |
| 789 | - $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage); |
|
| 789 | + $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage); |
|
| 790 | 790 | } |
| 791 | 791 | |
| 792 | 792 | return [ |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $cacheAnnot = $classAnnotations[Mapping\Cache::class]; |
| 150 | 150 | $cacheMap = [ |
| 151 | 151 | 'region' => $cacheAnnot->region, |
| 152 | - 'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage), |
|
| 152 | + 'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$cacheAnnot->usage), |
|
| 153 | 153 | ]; |
| 154 | 154 | |
| 155 | 155 | $metadata->enableCache($cacheMap); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $inheritanceTypeAnnot = $classAnnotations[Mapping\InheritanceType::class]; |
| 238 | 238 | |
| 239 | 239 | $metadata->setInheritanceType( |
| 240 | - constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceTypeAnnot->value) |
|
| 240 | + constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceTypeAnnot->value) |
|
| 241 | 241 | ); |
| 242 | 242 | |
| 243 | 243 | if ($metadata->inheritanceType != Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) { |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | // Evaluate DoctrineChangeTrackingPolicy annotation |
| 270 | 270 | if (isset($classAnnotations[Mapping\ChangeTrackingPolicy::class])) { |
| 271 | 271 | $changeTrackingAnnot = $classAnnotations[Mapping\ChangeTrackingPolicy::class]; |
| 272 | - $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_' . $changeTrackingAnnot->value)); |
|
| 272 | + $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_'.$changeTrackingAnnot->value)); |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | // Evaluate annotations on properties/fields |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $mapping['cache'] = $metadata->getAssociationCacheDefaults( |
| 294 | 294 | $mapping['fieldName'], |
| 295 | 295 | [ |
| 296 | - 'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage), |
|
| 296 | + 'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$cacheAnnot->usage), |
|
| 297 | 297 | 'region' => $cacheAnnot->region, |
| 298 | 298 | ] |
| 299 | 299 | ); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | if ($generatedValueAnnot = $this->reader->getPropertyAnnotation($property, Mapping\GeneratedValue::class)) { |
| 326 | - $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $generatedValueAnnot->strategy)); |
|
| 326 | + $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_'.$generatedValueAnnot->strategy)); |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | if ($this->reader->getPropertyAnnotation($property, Mapping\Version::class)) { |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | // Evaluate the listener using naming convention. |
| 514 | - if ( ! $hasMapping ) { |
|
| 514 | + if ( ! $hasMapping) { |
|
| 515 | 515 | EntityListenerBuilder::bindEntityListener($metadata, $listenerClassName); |
| 516 | 516 | } |
| 517 | 517 | } |
@@ -540,11 +540,11 @@ discard block |
||
| 540 | 540 | */ |
| 541 | 541 | private function getFetchMode($className, $fetchMode) |
| 542 | 542 | { |
| 543 | - if ( ! defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode)) { |
|
| 543 | + if ( ! defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$fetchMode)) { |
|
| 544 | 544 | throw MappingException::invalidFetchMode($className, $fetchMode); |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | - return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode); |
|
| 547 | + return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$fetchMode); |
|
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | /** |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public function exportClassMetadata(ClassMetadataInfo $metadata) |
| 42 | 42 | { |
| 43 | 43 | $xml = new \SimpleXmlElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><doctrine-mapping ". |
| 44 | - "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" " . |
|
| 44 | + "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" ". |
|
| 45 | 45 | "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ". |
| 46 | 46 | "xsi:schemaLocation=\"http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd\" />"); |
| 47 | 47 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy); |
| 99 | 99 | |
| 100 | - if ( $trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
| 100 | + if ($trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
| 101 | 101 | $root->addChild('change-tracking-policy', $trackingPolicy); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | if (count($cascade) === 5) { |
| 298 | - $cascade = ['cascade-all']; |
|
| 298 | + $cascade = ['cascade-all']; |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | if ($cascade) { |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) { |
|
| 380 | + if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks) > 0) { |
|
| 381 | 381 | $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks'); |
| 382 | 382 | |
| 383 | 383 | foreach ($metadata->lifecycleCallbacks as $name => $methods) { |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | { |
| 427 | 427 | $sequenceDefinition = $metadata->sequenceGeneratorDefinition; |
| 428 | 428 | |
| 429 | - if (! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
| 429 | + if ( ! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
| 430 | 430 | return; |
| 431 | 431 | } |
| 432 | 432 | |
@@ -212,12 +212,12 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | if ( ! $this->fileLockRegionDirectory) { |
| 214 | 214 | throw new \LogicException( |
| 215 | - 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, ' . |
|
| 215 | + 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, '. |
|
| 216 | 216 | 'The default implementation provided by doctrine is "Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory, DefaultCacheFactory#setFileLockRegionDirectory(). ' |
| 217 | 217 | ); |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - $directory = $this->fileLockRegionDirectory . DIRECTORY_SEPARATOR . $cache['region']; |
|
| 220 | + $directory = $this->fileLockRegionDirectory.DIRECTORY_SEPARATOR.$cache['region']; |
|
| 221 | 221 | $region = new FileLockRegion($region, $directory, $this->regionsConfig->getLockLifetime($cache['region'])); |
| 222 | 222 | } |
| 223 | 223 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | { |
| 234 | 234 | $cacheAdapter = clone $this->cache; |
| 235 | 235 | |
| 236 | - if (!$cacheAdapter instanceof CacheProvider) { |
|
| 236 | + if ( ! $cacheAdapter instanceof CacheProvider) { |
|
| 237 | 237 | return $cacheAdapter; |
| 238 | 238 | } |
| 239 | 239 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $namespace .= ':'; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $cacheAdapter->setNamespace($namespace . $name); |
|
| 246 | + $cacheAdapter->setNamespace($namespace.$name); |
|
| 247 | 247 | |
| 248 | 248 | return $cacheAdapter; |
| 249 | 249 | } |