@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function __construct($sort = null, $order = null) |
| 35 | 35 | { |
| 36 | - if (! $sort) { |
|
| 36 | + if ( ! $sort) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | public function add($sort, $order = null) |
| 48 | 48 | { |
| 49 | 49 | $order = ! $order ? 'ASC' : $order; |
| 50 | - $this->parts[] = $sort . ' ' . $order; |
|
| 50 | + $this->parts[] = $sort.' '.$order; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -71,6 +71,6 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function __toString() |
| 73 | 73 | { |
| 74 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
| 74 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
| 75 | 75 | } |
| 76 | 76 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $this->proxyFactory = new StaticProxyFactory($this, $this->config->buildGhostObjectFactory()); |
| 164 | 164 | $this->identifierFlattener = new IdentifierFlattener($this->unitOfWork, $this->metadataFactory); |
| 165 | 165 | |
| 166 | - if (! $config->isSecondLevelCacheEnabled()) { |
|
| 166 | + if ( ! $config->isSecondLevelCacheEnabled()) { |
|
| 167 | 167 | return; |
| 168 | 168 | } |
| 169 | 169 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | { |
| 292 | 292 | $query = new Query($this); |
| 293 | 293 | |
| 294 | - if (! empty($dql)) { |
|
| 294 | + if ( ! empty($dql)) { |
|
| 295 | 295 | $query->setDQL($dql); |
| 296 | 296 | } |
| 297 | 297 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
| 382 | 382 | $className = $class->getClassName(); |
| 383 | 383 | |
| 384 | - if (! is_array($id)) { |
|
| 384 | + if ( ! is_array($id)) { |
|
| 385 | 385 | if ($class->isIdentifierComposite()) { |
| 386 | 386 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
| 387 | 387 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | foreach ($id as $i => $value) { |
| 393 | - if (! is_object($value) || ! $this->metadataFactory->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 393 | + if ( ! is_object($value) || ! $this->metadataFactory->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 394 | 394 | continue; |
| 395 | 395 | } |
| 396 | 396 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | $sortedId = []; |
| 405 | 405 | |
| 406 | 406 | foreach ($class->identifier as $identifier) { |
| 407 | - if (! isset($id[$identifier])) { |
|
| 407 | + if ( ! isset($id[$identifier])) { |
|
| 408 | 408 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
| 409 | 409 | } |
| 410 | 410 | |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | // Check identity map first |
| 422 | 422 | $entity = $unitOfWork->tryGetById($sortedId, $class->getRootClassName()); |
| 423 | 423 | if ($entity !== false) { |
| 424 | - if (! ($entity instanceof $className)) { |
|
| 424 | + if ( ! ($entity instanceof $className)) { |
|
| 425 | 425 | return null; |
| 426 | 426 | } |
| 427 | 427 | |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | |
| 446 | 446 | switch (true) { |
| 447 | 447 | case $lockMode === LockMode::OPTIMISTIC: |
| 448 | - if (! $class->isVersioned()) { |
|
| 448 | + if ( ! $class->isVersioned()) { |
|
| 449 | 449 | throw OptimisticLockException::notVersioned($className); |
| 450 | 450 | } |
| 451 | 451 | |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | |
| 458 | 458 | case $lockMode === LockMode::PESSIMISTIC_READ: |
| 459 | 459 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
| 460 | - if (! $this->getConnection()->isTransactionActive()) { |
|
| 460 | + if ( ! $this->getConnection()->isTransactionActive()) { |
|
| 461 | 461 | throw TransactionRequiredException::transactionRequired(); |
| 462 | 462 | } |
| 463 | 463 | |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
| 477 | 477 | $className = $class->getClassName(); |
| 478 | 478 | |
| 479 | - if (! is_array($id)) { |
|
| 479 | + if ( ! is_array($id)) { |
|
| 480 | 480 | if ($class->isIdentifierComposite()) { |
| 481 | 481 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
| 482 | 482 | } |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | foreach ($id as $i => $value) { |
| 490 | 490 | $scalarId[$i] = $value; |
| 491 | 491 | |
| 492 | - if (! is_object($value) || ! $this->metadataFactory->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 492 | + if ( ! is_object($value) || ! $this->metadataFactory->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 493 | 493 | continue; |
| 494 | 494 | } |
| 495 | 495 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | $sortedId = []; |
| 504 | 504 | |
| 505 | 505 | foreach ($class->identifier as $identifier) { |
| 506 | - if (! isset($scalarId[$identifier])) { |
|
| 506 | + if ( ! isset($scalarId[$identifier])) { |
|
| 507 | 507 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
| 508 | 508 | } |
| 509 | 509 | |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
| 545 | 545 | $className = $class->getClassName(); |
| 546 | 546 | |
| 547 | - if (! is_array($id)) { |
|
| 547 | + if ( ! is_array($id)) { |
|
| 548 | 548 | if ($class->isIdentifierComposite()) { |
| 549 | 549 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
| 550 | 550 | } |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | foreach ($id as $i => $value) { |
| 556 | - if (! is_object($value) || ! $this->metadataFactory->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 556 | + if ( ! is_object($value) || ! $this->metadataFactory->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 557 | 557 | continue; |
| 558 | 558 | } |
| 559 | 559 | |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | $sortedId = []; |
| 568 | 568 | |
| 569 | 569 | foreach ($class->identifier as $identifier) { |
| 570 | - if (! isset($id[$identifier])) { |
|
| 570 | + if ( ! isset($id[$identifier])) { |
|
| 571 | 571 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
| 572 | 572 | } |
| 573 | 573 | |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | |
| 610 | 610 | $this->unitOfWork = new UnitOfWork($this); |
| 611 | 611 | |
| 612 | - if (! $this->eventManager->hasListeners(Events::onClear)) { |
|
| 612 | + if ( ! $this->eventManager->hasListeners(Events::onClear)) { |
|
| 613 | 613 | return; |
| 614 | 614 | } |
| 615 | 615 | |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | */ |
| 643 | 643 | public function persist($entity) |
| 644 | 644 | { |
| 645 | - if (! is_object($entity)) { |
|
| 645 | + if ( ! is_object($entity)) { |
|
| 646 | 646 | throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity); |
| 647 | 647 | } |
| 648 | 648 | |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | */ |
| 665 | 665 | public function remove($entity) |
| 666 | 666 | { |
| 667 | - if (! is_object($entity)) { |
|
| 667 | + if ( ! is_object($entity)) { |
|
| 668 | 668 | throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity); |
| 669 | 669 | } |
| 670 | 670 | |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | */ |
| 685 | 685 | public function refresh($entity) |
| 686 | 686 | { |
| 687 | - if (! is_object($entity)) { |
|
| 687 | + if ( ! is_object($entity)) { |
|
| 688 | 688 | throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity); |
| 689 | 689 | } |
| 690 | 690 | |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | */ |
| 840 | 840 | public static function create($connection, Configuration $config, ?EventManager $eventManager = null) |
| 841 | 841 | { |
| 842 | - if (! $config->getMetadataDriverImpl()) { |
|
| 842 | + if ( ! $config->getMetadataDriverImpl()) { |
|
| 843 | 843 | throw MissingMappingDriverImplementation::create(); |
| 844 | 844 | } |
| 845 | 845 | |
@@ -866,12 +866,12 @@ discard block |
||
| 866 | 866 | return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager()); |
| 867 | 867 | } |
| 868 | 868 | |
| 869 | - if (! $connection instanceof Connection) { |
|
| 869 | + if ( ! $connection instanceof Connection) { |
|
| 870 | 870 | throw new \InvalidArgumentException( |
| 871 | 871 | sprintf( |
| 872 | 872 | 'Invalid $connection argument of type %s given%s.', |
| 873 | 873 | is_object($connection) ? get_class($connection) : gettype($connection), |
| 874 | - is_object($connection) ? '' : ': "' . $connection . '"' |
|
| 874 | + is_object($connection) ? '' : ': "'.$connection.'"' |
|
| 875 | 875 | ) |
| 876 | 876 | ); |
| 877 | 877 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | // remove namespace separators from remaining class name |
| 46 | 46 | $fileName = str_replace('\\', '', $classNameRelativeToMetadataNamespace); |
| 47 | 47 | |
| 48 | - return $metadataDir . DIRECTORY_SEPARATOR . $fileName . '.php'; |
|
| 48 | + return $metadataDir.DIRECTORY_SEPARATOR.$fileName.'.php'; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ) : \Closure { |
| 63 | 63 | $metadataNamespace = ltrim($metadataNamespace, '\\'); |
| 64 | 64 | |
| 65 | - if (! ($notFoundCallback === null || is_callable($notFoundCallback))) { |
|
| 65 | + if ( ! ($notFoundCallback === null || is_callable($notFoundCallback))) { |
|
| 66 | 66 | $type = is_object($notFoundCallback) ? get_class($notFoundCallback) : gettype($notFoundCallback); |
| 67 | 67 | |
| 68 | 68 | throw new InvalidArgumentException( |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | ); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $autoloader = function ($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) { |
|
| 73 | + $autoloader = function($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) { |
|
| 74 | 74 | if (strpos($className, $metadataNamespace) !== 0) { |
| 75 | 75 | return; |
| 76 | 76 | } |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | { |
| 182 | 182 | parent::addDeclaredProperty($property); |
| 183 | 183 | |
| 184 | - if (! ($property instanceof VersionFieldMetadata)) { |
|
| 184 | + if ( ! ($property instanceof VersionFieldMetadata)) { |
|
| 185 | 185 | return; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | $className = trim($className, '\\'); |
| 33 | 33 | |
| 34 | - if (! isset($this->instances[$className])) { |
|
| 34 | + if ( ! isset($this->instances[$className])) { |
|
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function register($object) |
| 45 | 45 | { |
| 46 | - if (! is_object($object)) { |
|
| 46 | + if ( ! is_object($object)) { |
|
| 47 | 47 | throw new \InvalidArgumentException(sprintf('An object was expected, but got "%s".', gettype($object))); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function getAllMetadata() : array |
| 126 | 126 | { |
| 127 | - if (! $this->initialized) { |
|
| 127 | + if ( ! $this->initialized) { |
|
| 128 | 128 | $this->initialize(); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | try { |
| 167 | 167 | if ($this->cacheDriver) { |
| 168 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
| 168 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
| 169 | 169 | |
| 170 | 170 | if ($cached instanceof ClassMetadata) { |
| 171 | 171 | $this->loadedMetadata[$realClassName] = $cached; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | foreach ($this->loadMetadata($realClassName, $metadataBuildingContext) as $loadedClass) { |
| 176 | 176 | $loadedClassName = $loadedClass->getClassName(); |
| 177 | 177 | |
| 178 | - $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, null); |
|
| 178 | + $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, null); |
|
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | } else { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } catch (CommonMappingException $loadingException) { |
| 185 | 185 | $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName, $metadataBuildingContext); |
| 186 | 186 | |
| 187 | - if (! $fallbackMetadataResponse) { |
|
| 187 | + if ( ! $fallbackMetadataResponse) { |
|
| 188 | 188 | throw $loadingException; |
| 189 | 189 | } |
| 190 | 190 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | protected function loadMetadata(string $name, ClassMetadataBuildingContext $metadataBuildingContext) : array |
| 222 | 222 | { |
| 223 | - if (! $this->initialized) { |
|
| 223 | + if ( ! $this->initialized) { |
|
| 224 | 224 | $this->initialize(); |
| 225 | 225 | } |
| 226 | 226 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public function isTransient($className) : bool |
| 258 | 258 | { |
| 259 | - if (! $this->initialized) { |
|
| 259 | + if ( ! $this->initialized) { |
|
| 260 | 260 | $this->initialize(); |
| 261 | 261 | } |
| 262 | 262 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | string $className, |
| 89 | 89 | ClassMetadataBuildingContext $metadataBuildingContext |
| 90 | 90 | ) : ?ClassMetadata { |
| 91 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 91 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 92 | 92 | return null; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | $classMetadata->setCache(clone $parent->getCache()); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - if (! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 152 | + if ( ! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 153 | 153 | $classMetadata->entityListeners = $parent->entityListeners; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 157 | + if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 158 | 158 | $this->addDefaultDiscriminatorMap($classMetadata); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | protected function completeRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 176 | 176 | { |
| 177 | - if (! $parent || ! $parent->isMappedSuperclass) { |
|
| 177 | + if ( ! $parent || ! $parent->isMappedSuperclass) { |
|
| 178 | 178 | return; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | continue; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
| 195 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
| 196 | 196 | continue; |
| 197 | 197 | } |
| 198 | 198 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 213 | 213 | { |
| 214 | - if (! $class->getReflectionClass()) { |
|
| 214 | + if ( ! $class->getReflectionClass()) { |
|
| 215 | 215 | // only validate if there is a reflection class instance |
| 216 | 216 | return; |
| 217 | 217 | } |
@@ -221,13 +221,13 @@ discard block |
||
| 221 | 221 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
| 222 | 222 | |
| 223 | 223 | // verify inheritance |
| 224 | - if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 225 | - if (! $parent) { |
|
| 226 | - if (! $class->discriminatorMap) { |
|
| 224 | + if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 225 | + if ( ! $parent) { |
|
| 226 | + if ( ! $class->discriminatorMap) { |
|
| 227 | 227 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - if (! $class->discriminatorColumn) { |
|
| 230 | + if ( ! $class->discriminatorColumn) { |
|
| 231 | 231 | throw MappingException::missingDiscriminatorColumn($class->getClassName()); |
| 232 | 232 | } |
| 233 | 233 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | $duplicates = []; |
| 306 | 306 | |
| 307 | 307 | foreach ($allClasses as $subClassCandidate) { |
| 308 | - if (! is_subclass_of($subClassCandidate, $fqcn)) { |
|
| 308 | + if ( ! is_subclass_of($subClassCandidate, $fqcn)) { |
|
| 309 | 309 | continue; |
| 310 | 310 | } |
| 311 | 311 | |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | private function completeIdentifierGeneratorMappings(ClassMetadata $class) : void |
| 351 | 351 | { |
| 352 | 352 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 353 | - if (! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 353 | + if ( ! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 354 | 354 | continue; |
| 355 | 355 | } |
| 356 | 356 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | |
| 361 | 361 | private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) |
| 362 | 362 | { |
| 363 | - if (! $field->hasValueGenerator()) { |
|
| 363 | + if ( ! $field->hasValueGenerator()) { |
|
| 364 | 364 | return; |
| 365 | 365 | } |
| 366 | 366 | |
@@ -412,10 +412,10 @@ discard block |
||
| 412 | 412 | |
| 413 | 413 | case GeneratorType::CUSTOM: |
| 414 | 414 | $definition = $generator->getDefinition(); |
| 415 | - if (! isset($definition['class'])) { |
|
| 415 | + if ( ! isset($definition['class'])) { |
|
| 416 | 416 | throw InvalidCustomGenerator::onClassNotConfigured(); |
| 417 | 417 | } |
| 418 | - if (! class_exists($definition['class'])) { |
|
| 418 | + if ( ! class_exists($definition['class'])) { |
|
| 419 | 419 | throw InvalidCustomGenerator::onMissingClass($definition); |
| 420 | 420 | } |
| 421 | 421 | |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | |
| 450 | 450 | private function getTargetPlatform() : Platforms\AbstractPlatform |
| 451 | 451 | { |
| 452 | - if (! $this->targetPlatform) { |
|
| 452 | + if ( ! $this->targetPlatform) { |
|
| 453 | 453 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
| 454 | 454 | } |
| 455 | 455 | |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 486 | 486 | $executor = $this->buildValueGenerationExecutorForProperty($class, $property); |
| 487 | 487 | |
| 488 | - if (! ($executor instanceof ValueGenerationExecutor)) { |
|
| 488 | + if ( ! ($executor instanceof ValueGenerationExecutor)) { |
|
| 489 | 489 | continue; |
| 490 | 490 | } |
| 491 | 491 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | $this->reader = $reader; |
| 92 | 92 | |
| 93 | - if (! $paths) { |
|
| 93 | + if ( ! $paths) { |
|
| 94 | 94 | return; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | return $this->classNames; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if (! $this->paths) { |
|
| 202 | + if ( ! $this->paths) { |
|
| 203 | 203 | throw Mapping\MappingException::pathRequired(); |
| 204 | 204 | } |
| 205 | 205 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $includedFiles = []; |
| 208 | 208 | |
| 209 | 209 | foreach ($this->paths as $path) { |
| 210 | - if (! is_dir($path)) { |
|
| 210 | + if ( ! is_dir($path)) { |
|
| 211 | 211 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 212 | 212 | } |
| 213 | 213 | |
@@ -216,14 +216,14 @@ discard block |
||
| 216 | 216 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
| 217 | 217 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 218 | 218 | ), |
| 219 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 219 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 220 | 220 | \RecursiveRegexIterator::GET_MATCH |
| 221 | 221 | ); |
| 222 | 222 | |
| 223 | 223 | foreach ($iterator as $file) { |
| 224 | 224 | $sourceFile = $file[0]; |
| 225 | 225 | |
| 226 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
| 226 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
| 227 | 227 | $sourceFile = realpath($sourceFile); |
| 228 | 228 | } |
| 229 | 229 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | foreach ($declared as $className) { |
| 248 | 248 | $rc = new \ReflectionClass($className); |
| 249 | 249 | $sourceFile = $rc->getFileName(); |
| 250 | - if (! in_array($sourceFile, $includedFiles, true) || $this->isTransient($className)) { |
|
| 250 | + if ( ! in_array($sourceFile, $includedFiles, true) || $this->isTransient($className)) { |
|
| 251 | 251 | continue; |
| 252 | 252 | } |
| 253 | 253 | |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | ) : Mapping\ClassMetadata { |
| 274 | 274 | $reflectionClass = $metadata->getReflectionClass(); |
| 275 | 275 | |
| 276 | - if (! $reflectionClass) { |
|
| 276 | + if ( ! $reflectionClass) { |
|
| 277 | 277 | // this happens when running annotation driver in combination with |
| 278 | 278 | // static reflection services. This is not the nicest fix |
| 279 | 279 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | $metadataBuildingContext |
| 311 | 311 | ); |
| 312 | 312 | |
| 313 | - if (! $property) { |
|
| 313 | + if ( ! $property) { |
|
| 314 | 314 | continue; |
| 315 | 315 | } |
| 316 | 316 | |
@@ -607,11 +607,11 @@ discard block |
||
| 607 | 607 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 608 | 608 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 609 | 609 | |
| 610 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 610 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 611 | 611 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 614 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 615 | 615 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 616 | 616 | } |
| 617 | 617 | |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 670 | 670 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 671 | 671 | |
| 672 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 672 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 673 | 673 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 674 | 674 | } |
| 675 | 675 | |
@@ -728,11 +728,11 @@ discard block |
||
| 728 | 728 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 729 | 729 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 730 | 730 | |
| 731 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 731 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 732 | 732 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 733 | 733 | } |
| 734 | 734 | |
| 735 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 735 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 736 | 736 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 737 | 737 | } |
| 738 | 738 | |
@@ -775,15 +775,15 @@ discard block |
||
| 775 | 775 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 776 | 776 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 777 | 777 | |
| 778 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 778 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 779 | 779 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 782 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 783 | 783 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 784 | 784 | } |
| 785 | 785 | |
| 786 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 786 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 787 | 787 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 788 | 788 | } |
| 789 | 789 | |
@@ -827,15 +827,15 @@ discard block |
||
| 827 | 827 | |
| 828 | 828 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 829 | 829 | |
| 830 | - if (! empty($columnAnnot->name)) { |
|
| 830 | + if ( ! empty($columnAnnot->name)) { |
|
| 831 | 831 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 832 | 832 | } |
| 833 | 833 | |
| 834 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 834 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 835 | 835 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 836 | 836 | } |
| 837 | 837 | |
| 838 | - if (! empty($columnAnnot->length)) { |
|
| 838 | + if ( ! empty($columnAnnot->length)) { |
|
| 839 | 839 | $fieldMetadata->setLength($columnAnnot->length); |
| 840 | 840 | } |
| 841 | 841 | |
@@ -858,11 +858,11 @@ discard block |
||
| 858 | 858 | Annotation\Table $tableAnnot, |
| 859 | 859 | Mapping\TableMetadata $table |
| 860 | 860 | ) : Mapping\TableMetadata { |
| 861 | - if (! empty($tableAnnot->name)) { |
|
| 861 | + if ( ! empty($tableAnnot->name)) { |
|
| 862 | 862 | $table->setName($tableAnnot->name); |
| 863 | 863 | } |
| 864 | 864 | |
| 865 | - if (! empty($tableAnnot->schema)) { |
|
| 865 | + if ( ! empty($tableAnnot->schema)) { |
|
| 866 | 866 | $table->setSchema($tableAnnot->schema); |
| 867 | 867 | } |
| 868 | 868 | |
@@ -900,11 +900,11 @@ discard block |
||
| 900 | 900 | ) : Mapping\JoinTableMetadata { |
| 901 | 901 | $joinTable = new Mapping\JoinTableMetadata(); |
| 902 | 902 | |
| 903 | - if (! empty($joinTableAnnot->name)) { |
|
| 903 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 904 | 904 | $joinTable->setName($joinTableAnnot->name); |
| 905 | 905 | } |
| 906 | 906 | |
| 907 | - if (! empty($joinTableAnnot->schema)) { |
|
| 907 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 908 | 908 | $joinTable->setSchema($joinTableAnnot->schema); |
| 909 | 909 | } |
| 910 | 910 | |
@@ -932,22 +932,22 @@ discard block |
||
| 932 | 932 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 933 | 933 | |
| 934 | 934 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 935 | - if (! empty($joinColumnAnnot->name)) { |
|
| 935 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 936 | 936 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 939 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 940 | 940 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 944 | 944 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 945 | 945 | |
| 946 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 946 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 947 | 947 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 948 | 948 | } |
| 949 | 949 | |
| 950 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 950 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 951 | 951 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 952 | 952 | } |
| 953 | 953 | |
@@ -969,7 +969,7 @@ discard block |
||
| 969 | 969 | $fieldName = null |
| 970 | 970 | ) : Mapping\CacheMetadata { |
| 971 | 971 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 972 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 972 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 973 | 973 | |
| 974 | 974 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 975 | 975 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1038,11 +1038,11 @@ discard block |
||
| 1038 | 1038 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1039 | 1039 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1040 | 1040 | |
| 1041 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1041 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1042 | 1042 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1045 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1046 | 1046 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1047 | 1047 | } |
| 1048 | 1048 | } |
@@ -1050,7 +1050,7 @@ discard block |
||
| 1050 | 1050 | $metadata->setDiscriminatorColumn($discriminatorColumn); |
| 1051 | 1051 | |
| 1052 | 1052 | // Evaluate DiscriminatorMap annotation |
| 1053 | - if (! isset($classAnnotations[Annotation\DiscriminatorMap::class])) { |
|
| 1053 | + if ( ! isset($classAnnotations[Annotation\DiscriminatorMap::class])) { |
|
| 1054 | 1054 | return; |
| 1055 | 1055 | } |
| 1056 | 1056 | |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | Mapping\ClassMetadata $metadata |
| 1070 | 1070 | ) : void { |
| 1071 | 1071 | // Evaluate @HasLifecycleCallbacks annotation |
| 1072 | - if (! isset($classAnnotations[Annotation\HasLifecycleCallbacks::class])) { |
|
| 1072 | + if ( ! isset($classAnnotations[Annotation\HasLifecycleCallbacks::class])) { |
|
| 1073 | 1073 | return; |
| 1074 | 1074 | } |
| 1075 | 1075 | |
@@ -1093,7 +1093,7 @@ discard block |
||
| 1093 | 1093 | Mapping\ClassMetadata $metadata |
| 1094 | 1094 | ) : void { |
| 1095 | 1095 | // Evaluate @EntityListeners annotation |
| 1096 | - if (! isset($classAnnotations[Annotation\EntityListeners::class])) { |
|
| 1096 | + if ( ! isset($classAnnotations[Annotation\EntityListeners::class])) { |
|
| 1097 | 1097 | return; |
| 1098 | 1098 | } |
| 1099 | 1099 | |
@@ -1101,7 +1101,7 @@ discard block |
||
| 1101 | 1101 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1102 | 1102 | |
| 1103 | 1103 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1104 | - if (! class_exists($listenerClassName)) { |
|
| 1104 | + if ( ! class_exists($listenerClassName)) { |
|
| 1105 | 1105 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1106 | 1106 | $listenerClassName, |
| 1107 | 1107 | $metadata->getClassName() |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | $fieldName = $associationOverride->name; |
| 1139 | 1139 | $property = $metadata->getProperty($fieldName); |
| 1140 | 1140 | |
| 1141 | - if (! $property) { |
|
| 1141 | + if ( ! $property) { |
|
| 1142 | 1142 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1143 | 1143 | } |
| 1144 | 1144 | |
@@ -1172,7 +1172,7 @@ discard block |
||
| 1172 | 1172 | // Check for fetch |
| 1173 | 1173 | if ($associationOverride->fetch) { |
| 1174 | 1174 | $override->setFetchMode( |
| 1175 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1175 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1176 | 1176 | ); |
| 1177 | 1177 | } |
| 1178 | 1178 | |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | } |
| 1182 | 1182 | |
| 1183 | 1183 | // Evaluate AttributeOverrides annotation |
| 1184 | - if (! isset($classAnnotations[Annotation\AttributeOverrides::class])) { |
|
| 1184 | + if ( ! isset($classAnnotations[Annotation\AttributeOverrides::class])) { |
|
| 1185 | 1185 | return; |
| 1186 | 1186 | } |
| 1187 | 1187 | |
@@ -1208,7 +1208,7 @@ discard block |
||
| 1208 | 1208 | Mapping\ClassMetadata $metadata |
| 1209 | 1209 | ) : void { |
| 1210 | 1210 | // Check for Cache |
| 1211 | - if (! isset($propertyAnnotations[Annotation\Cache::class])) { |
|
| 1211 | + if ( ! isset($propertyAnnotations[Annotation\Cache::class])) { |
|
| 1212 | 1212 | return; |
| 1213 | 1213 | } |
| 1214 | 1214 | |
@@ -1265,7 +1265,7 @@ discard block |
||
| 1265 | 1265 | { |
| 1266 | 1266 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1267 | 1267 | |
| 1268 | - if (! defined($fetchModeConstant)) { |
|
| 1268 | + if ( ! defined($fetchModeConstant)) { |
|
| 1269 | 1269 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1270 | 1270 | } |
| 1271 | 1271 | |
@@ -1295,7 +1295,7 @@ discard block |
||
| 1295 | 1295 | $callbacks = []; |
| 1296 | 1296 | |
| 1297 | 1297 | foreach ($events as $eventName => $annotationClassName) { |
| 1298 | - if (! isset($annotations[$annotationClassName]) && $method->getName() !== $eventName) { |
|
| 1298 | + if ( ! isset($annotations[$annotationClassName]) && $method->getName() !== $eventName) { |
|
| 1299 | 1299 | continue; |
| 1300 | 1300 | } |
| 1301 | 1301 | |
@@ -1313,7 +1313,7 @@ discard block |
||
| 1313 | 1313 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1314 | 1314 | |
| 1315 | 1315 | foreach ($classAnnotations as $key => $annot) { |
| 1316 | - if (! is_numeric($key)) { |
|
| 1316 | + if ( ! is_numeric($key)) { |
|
| 1317 | 1317 | continue; |
| 1318 | 1318 | } |
| 1319 | 1319 | |
@@ -1331,7 +1331,7 @@ discard block |
||
| 1331 | 1331 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1332 | 1332 | |
| 1333 | 1333 | foreach ($propertyAnnotations as $key => $annot) { |
| 1334 | - if (! is_numeric($key)) { |
|
| 1334 | + if ( ! is_numeric($key)) { |
|
| 1335 | 1335 | continue; |
| 1336 | 1336 | } |
| 1337 | 1337 | |
@@ -1349,7 +1349,7 @@ discard block |
||
| 1349 | 1349 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1350 | 1350 | |
| 1351 | 1351 | foreach ($methodAnnotations as $key => $annot) { |
| 1352 | - if (! is_numeric($key)) { |
|
| 1352 | + if ( ! is_numeric($key)) { |
|
| 1353 | 1353 | continue; |
| 1354 | 1354 | } |
| 1355 | 1355 | |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | ) { |
| 143 | 143 | $this->reverseEngineerMappingFromDatabase(); |
| 144 | 144 | |
| 145 | - if (! isset($this->classToTableNames[$className])) { |
|
| 146 | - throw new \InvalidArgumentException('Unknown class ' . $className); |
|
| 145 | + if ( ! isset($this->classToTableNames[$className])) { |
|
| 146 | + throw new \InvalidArgumentException('Unknown class '.$className); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // @todo guilhermeblanco This should somehow disappear... =) |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | foreach ($this->manyToManyTables as $manyTable) { |
| 159 | 159 | foreach ($manyTable->getForeignKeys() as $foreignKey) { |
| 160 | 160 | // foreign key maps to the table of the current entity, many to many association probably exists |
| 161 | - if (! ($loweredTableName === strtolower($foreignKey->getForeignTableName()))) { |
|
| 161 | + if ( ! ($loweredTableName === strtolower($foreignKey->getForeignTableName()))) { |
|
| 162 | 162 | continue; |
| 163 | 163 | } |
| 164 | 164 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - if (! $otherFk) { |
|
| 176 | + if ( ! $otherFk) { |
|
| 177 | 177 | // the definition of this many to many table does not contain |
| 178 | 178 | // enough foreign key information to continue reverse engineering. |
| 179 | 179 | continue; |
@@ -254,9 +254,9 @@ discard block |
||
| 254 | 254 | $allForeignKeyColumns = array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns()); |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - if (! $table->hasPrimaryKey()) { |
|
| 257 | + if ( ! $table->hasPrimaryKey()) { |
|
| 258 | 258 | throw new Mapping\MappingException( |
| 259 | - 'Table ' . $table->getName() . ' has no primary key. Doctrine does not ' . |
|
| 259 | + 'Table '.$table->getName().' has no primary key. Doctrine does not '. |
|
| 260 | 260 | "support reverse engineering from tables that don't have a primary key." |
| 261 | 261 | ); |
| 262 | 262 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | // We need to check for the columns here, because we might have associations as id as well. |
| 346 | - if (! $ids || count($primaryKeys) !== 1) { |
|
| 346 | + if ( ! $ids || count($primaryKeys) !== 1) { |
|
| 347 | 347 | return; |
| 348 | 348 | } |
| 349 | 349 | |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | // Here we need to check if $fkColumns are the same as $primaryKeys |
| 451 | - if (! array_diff($fkColumns, $primaryKeys)) { |
|
| 451 | + if ( ! array_diff($fkColumns, $primaryKeys)) { |
|
| 452 | 452 | $metadata->addProperty($associationMapping); |
| 453 | 453 | } else { |
| 454 | 454 | $metadata->addProperty($associationMapping); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | private function getClassNameForTable($tableName) |
| 495 | 495 | { |
| 496 | - return $this->namespace . ( |
|
| 496 | + return $this->namespace.( |
|
| 497 | 497 | $this->classNamesForTables[$tableName] |
| 498 | 498 | ?? Inflector::classify(strtolower($tableName)) |
| 499 | 499 | ); |