@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | { |
291 | 291 | $query = new Query($this); |
292 | 292 | |
293 | - if (! empty($dql)) { |
|
293 | + if ( ! empty($dql)) { |
|
294 | 294 | $query->setDQL($dql); |
295 | 295 | } |
296 | 296 | |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $this->checkLockRequirements($lockMode, $class); |
382 | 382 | } |
383 | 383 | |
384 | - if (! is_array($id)) { |
|
384 | + if ( ! is_array($id)) { |
|
385 | 385 | if ($class->isIdentifierComposite()) { |
386 | 386 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
387 | 387 | } |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | $sortedId = []; |
403 | 403 | |
404 | 404 | foreach ($class->identifier as $identifier) { |
405 | - if (! isset($id[$identifier])) { |
|
405 | + if ( ! isset($id[$identifier])) { |
|
406 | 406 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
407 | 407 | } |
408 | 408 | |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | // Check identity map first |
420 | 420 | $entity = $unitOfWork->tryGetById($sortedId, $class->getRootClassName()); |
421 | 421 | if ($entity !== false) { |
422 | - if (! ($entity instanceof $className)) { |
|
422 | + if ( ! ($entity instanceof $className)) { |
|
423 | 423 | return null; |
424 | 424 | } |
425 | 425 | |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
465 | 465 | $className = $class->getClassName(); |
466 | 466 | |
467 | - if (! is_array($id)) { |
|
467 | + if ( ! is_array($id)) { |
|
468 | 468 | if ($class->isIdentifierComposite()) { |
469 | 469 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
470 | 470 | } |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $sortedId = []; |
490 | 490 | |
491 | 491 | foreach ($class->identifier as $identifier) { |
492 | - if (! isset($scalarId[$identifier])) { |
|
492 | + if ( ! isset($scalarId[$identifier])) { |
|
493 | 493 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
494 | 494 | } |
495 | 495 | |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
531 | 531 | $className = $class->getClassName(); |
532 | 532 | |
533 | - if (! is_array($id)) { |
|
533 | + if ( ! is_array($id)) { |
|
534 | 534 | if ($class->isIdentifierComposite()) { |
535 | 535 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
536 | 536 | } |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | $sortedId = []; |
552 | 552 | |
553 | 553 | foreach ($class->identifier as $identifier) { |
554 | - if (! isset($id[$identifier])) { |
|
554 | + if ( ! isset($id[$identifier])) { |
|
555 | 555 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
556 | 556 | } |
557 | 557 | |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | */ |
625 | 625 | public function persist($entity) |
626 | 626 | { |
627 | - if (! is_object($entity)) { |
|
627 | + if ( ! is_object($entity)) { |
|
628 | 628 | throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity); |
629 | 629 | } |
630 | 630 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | */ |
647 | 647 | public function remove($entity) |
648 | 648 | { |
649 | - if (! is_object($entity)) { |
|
649 | + if ( ! is_object($entity)) { |
|
650 | 650 | throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity); |
651 | 651 | } |
652 | 652 | |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | */ |
667 | 667 | public function refresh($entity) |
668 | 668 | { |
669 | - if (! is_object($entity)) { |
|
669 | + if ( ! is_object($entity)) { |
|
670 | 670 | throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity); |
671 | 671 | } |
672 | 672 | |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | */ |
822 | 822 | public static function create($connection, Configuration $config, ?EventManager $eventManager = null) |
823 | 823 | { |
824 | - if (! $config->getMetadataDriverImpl()) { |
|
824 | + if ( ! $config->getMetadataDriverImpl()) { |
|
825 | 825 | throw MissingMappingDriverImplementation::create(); |
826 | 826 | } |
827 | 827 | |
@@ -848,12 +848,12 @@ discard block |
||
848 | 848 | return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager()); |
849 | 849 | } |
850 | 850 | |
851 | - if (! $connection instanceof Connection) { |
|
851 | + if ( ! $connection instanceof Connection) { |
|
852 | 852 | throw new \InvalidArgumentException( |
853 | 853 | sprintf( |
854 | 854 | 'Invalid $connection argument of type %s given%s.', |
855 | 855 | is_object($connection) ? get_class($connection) : gettype($connection), |
856 | - is_object($connection) ? '' : ': "' . $connection . '"' |
|
856 | + is_object($connection) ? '' : ': "'.$connection.'"' |
|
857 | 857 | ) |
858 | 858 | ); |
859 | 859 | } |
@@ -901,13 +901,13 @@ discard block |
||
901 | 901 | { |
902 | 902 | switch ($lockMode) { |
903 | 903 | case LockMode::OPTIMISTIC: |
904 | - if (! $class->isVersioned()) { |
|
904 | + if ( ! $class->isVersioned()) { |
|
905 | 905 | throw OptimisticLockException::notVersioned($class->getClassName()); |
906 | 906 | } |
907 | 907 | break; |
908 | 908 | case LockMode::PESSIMISTIC_READ: |
909 | 909 | case LockMode::PESSIMISTIC_WRITE: |
910 | - if (! $this->getConnection()->isTransactionActive()) { |
|
910 | + if ( ! $this->getConnection()->isTransactionActive()) { |
|
911 | 911 | throw TransactionRequiredException::transactionRequired(); |
912 | 912 | } |
913 | 913 | } |
@@ -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... =) |
@@ -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 | } |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | } |
447 | 447 | |
448 | 448 | // Here we need to check if $fkColumns are the same as $primaryKeys |
449 | - if (! array_diff($fkColumns, $primaryKeys)) { |
|
449 | + if ( ! array_diff($fkColumns, $primaryKeys)) { |
|
450 | 450 | $metadata->addProperty($associationMapping); |
451 | 451 | } else { |
452 | 452 | $metadata->addProperty($associationMapping); |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | */ |
492 | 492 | private function getClassNameForTable($tableName) |
493 | 493 | { |
494 | - return $this->namespace . ( |
|
494 | + return $this->namespace.( |
|
495 | 495 | $this->classNamesForTables[$tableName] |
496 | 496 | ?? Inflector::classify(strtolower($tableName)) |
497 | 497 | ); |