@@ -9,7 +9,7 @@ |
||
| 9 | 9 | public static function create() : self |
| 10 | 10 | { |
| 11 | 11 | return new self( |
| 12 | - "It's a requirement to specify a Metadata Driver and pass it " . |
|
| 12 | + "It's a requirement to specify a Metadata Driver and pass it ". |
|
| 13 | 13 | 'to Doctrine\\ORM\\Configuration::setMetadataDriverImpl().' |
| 14 | 14 | ); |
| 15 | 15 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | $this->computeChangeSets(); |
| 338 | 338 | |
| 339 | - if (! ($this->entityInsertions || |
|
| 339 | + if ( ! ($this->entityInsertions || |
|
| 340 | 340 | $this->entityDeletions || |
| 341 | 341 | $this->entityUpdates || |
| 342 | 342 | $this->collectionUpdates || |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | // Entity deletions come last and need to be in reverse commit order |
| 396 | 396 | if ($this->entityDeletions) { |
| 397 | 397 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
| 398 | - if (! $this->entityDeletions) { |
|
| 398 | + if ( ! $this->entityDeletions) { |
|
| 399 | 399 | break; // just a performance optimisation |
| 400 | 400 | } |
| 401 | 401 | |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $oid = spl_object_id($entity); |
| 479 | 479 | $data = []; |
| 480 | 480 | |
| 481 | - if (! isset($this->entityChangeSets[$oid])) { |
|
| 481 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 482 | 482 | return $data; |
| 483 | 483 | } |
| 484 | 484 | |
@@ -559,12 +559,12 @@ discard block |
||
| 559 | 559 | || ! $class->getProperty($name) instanceof FieldMetadata |
| 560 | 560 | || ! $class->getProperty($name)->hasValueGenerator() |
| 561 | 561 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
| 562 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 562 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 563 | 563 | $actualData[$name] = $value; |
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 567 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 568 | 568 | // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). |
| 569 | 569 | // These result in an INSERT. |
| 570 | 570 | $this->originalEntityData[$oid] = $actualData; |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | |
| 592 | 592 | foreach ($actualData as $propName => $actualValue) { |
| 593 | 593 | // skip field, its a partially omitted one! |
| 594 | - if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 594 | + if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 595 | 595 | continue; |
| 596 | 596 | } |
| 597 | 597 | |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | if ($owner === null) { // cloned |
| 614 | 614 | $actualValue->setOwner($entity, $property); |
| 615 | 615 | } elseif ($owner !== $entity) { // no clone, we have to fix |
| 616 | - if (! $actualValue->isInitialized()) { |
|
| 616 | + if ( ! $actualValue->isInitialized()) { |
|
| 617 | 617 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 618 | 618 | } |
| 619 | 619 | |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | // Check if original value exists |
| 652 | 652 | if ($orgValue instanceof PersistentCollection) { |
| 653 | 653 | // A PersistentCollection was de-referenced, so delete it. |
| 654 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 654 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 655 | 655 | $this->scheduleCollectionDeletion($orgValue); |
| 656 | 656 | |
| 657 | 657 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | |
| 675 | 675 | // Look for changes in associations of the entity |
| 676 | 676 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 677 | - if (! $property instanceof AssociationMetadata) { |
|
| 677 | + if ( ! $property instanceof AssociationMetadata) { |
|
| 678 | 678 | continue; |
| 679 | 679 | } |
| 680 | 680 | |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here. |
| 742 | 742 | $oid = spl_object_id($entity); |
| 743 | 743 | |
| 744 | - if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 744 | + if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 745 | 745 | $this->computeChangeSet($class, $entity); |
| 746 | 746 | } |
| 747 | 747 | } |
@@ -778,13 +778,13 @@ discard block |
||
| 778 | 778 | $targetClass = $this->em->getClassMetadata($targetEntity); |
| 779 | 779 | |
| 780 | 780 | foreach ($unwrappedValue as $key => $entry) { |
| 781 | - if (! ($entry instanceof $targetEntity)) { |
|
| 781 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 782 | 782 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | $state = $this->getEntityState($entry, self::STATE_NEW); |
| 786 | 786 | |
| 787 | - if (! ($entry instanceof $targetEntity)) { |
|
| 787 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 788 | 788 | throw UnexpectedAssociationValue::create( |
| 789 | 789 | $association->getSourceEntity(), |
| 790 | 790 | $association->getName(), |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | |
| 796 | 796 | switch ($state) { |
| 797 | 797 | case self::STATE_NEW: |
| 798 | - if (! in_array('persist', $association->getCascade(), true)) { |
|
| 798 | + if ( ! in_array('persist', $association->getCascade(), true)) { |
|
| 799 | 799 | $this->nonCascadedNewDetectedEntities[spl_object_id($entry)] = [$association, $entry]; |
| 800 | 800 | |
| 801 | 801 | break; |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | $persister = $this->getEntityPersister($class->getClassName()); |
| 845 | 845 | $generationPlan->executeImmediate($this->em, $entity); |
| 846 | 846 | |
| 847 | - if (! $generationPlan->containsDeferred()) { |
|
| 847 | + if ( ! $generationPlan->containsDeferred()) { |
|
| 848 | 848 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
| 849 | 849 | $this->entityIdentifiers[$oid] = $id; |
| 850 | 850 | } |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | { |
| 876 | 876 | $oid = spl_object_id($entity); |
| 877 | 877 | |
| 878 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 878 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 879 | 879 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
| 880 | 880 | } |
| 881 | 881 | |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | break; |
| 898 | 898 | |
| 899 | 899 | case ($property instanceof FieldMetadata): |
| 900 | - if (! $property->isPrimaryKey() |
|
| 900 | + if ( ! $property->isPrimaryKey() |
|
| 901 | 901 | || ! $property->getValueGenerator() |
| 902 | 902 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
| 903 | 903 | $actualData[$name] = $property->getValue($entity); |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | } |
| 912 | 912 | } |
| 913 | 913 | |
| 914 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 914 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 915 | 915 | throw new \RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.'); |
| 916 | 916 | } |
| 917 | 917 | |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | if ($changeSet) { |
| 930 | 930 | if (isset($this->entityChangeSets[$oid])) { |
| 931 | 931 | $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); |
| 932 | - } elseif (! isset($this->entityInsertions[$oid])) { |
|
| 932 | + } elseif ( ! isset($this->entityInsertions[$oid])) { |
|
| 933 | 933 | $this->entityChangeSets[$oid] = $changeSet; |
| 934 | 934 | $this->entityUpdates[$oid] = $entity; |
| 935 | 935 | } |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | $this->recomputeSingleEntityChangeSet($class, $entity); |
| 1000 | 1000 | } |
| 1001 | 1001 | |
| 1002 | - if (! empty($this->entityChangeSets[$oid])) { |
|
| 1002 | + if ( ! empty($this->entityChangeSets[$oid])) { |
|
| 1003 | 1003 | // echo 'Update: '; |
| 1004 | 1004 | // \Doctrine\Common\Util\Debug::dump($this->entityChangeSets[$oid], 3); |
| 1005 | 1005 | |
@@ -1042,7 +1042,7 @@ discard block |
||
| 1042 | 1042 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1043 | 1043 | // is obtained by a new entity because the old one went out of scope. |
| 1044 | 1044 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1045 | - if (! $class->isIdentifierComposite()) { |
|
| 1045 | + if ( ! $class->isIdentifierComposite()) { |
|
| 1046 | 1046 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
| 1047 | 1047 | |
| 1048 | 1048 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1089,13 +1089,13 @@ discard block |
||
| 1089 | 1089 | // Calculate dependencies for new nodes |
| 1090 | 1090 | while ($class = array_pop($newNodes)) { |
| 1091 | 1091 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 1092 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1092 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1093 | 1093 | continue; |
| 1094 | 1094 | } |
| 1095 | 1095 | |
| 1096 | 1096 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 1097 | 1097 | |
| 1098 | - if (! $calc->hasNode($targetClass->getClassName())) { |
|
| 1098 | + if ( ! $calc->hasNode($targetClass->getClassName())) { |
|
| 1099 | 1099 | $calc->addNode($targetClass->getClassName(), $targetClass); |
| 1100 | 1100 | |
| 1101 | 1101 | $newNodes[] = $targetClass; |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | |
| 1104 | 1104 | $weight = ! array_filter( |
| 1105 | 1105 | $property->getJoinColumns(), |
| 1106 | - function (JoinColumnMetadata $joinColumn) { |
|
| 1106 | + function(JoinColumnMetadata $joinColumn) { |
|
| 1107 | 1107 | return $joinColumn->isNullable(); |
| 1108 | 1108 | } |
| 1109 | 1109 | ); |
@@ -1111,14 +1111,14 @@ discard block |
||
| 1111 | 1111 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
| 1112 | 1112 | |
| 1113 | 1113 | // If the target class has mapped subclasses, these share the same dependency. |
| 1114 | - if (! $targetClass->getSubClasses()) { |
|
| 1114 | + if ( ! $targetClass->getSubClasses()) { |
|
| 1115 | 1115 | continue; |
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | 1118 | foreach ($targetClass->getSubClasses() as $subClassName) { |
| 1119 | 1119 | $targetSubClass = $this->em->getClassMetadata($subClassName); |
| 1120 | 1120 | |
| 1121 | - if (! $calc->hasNode($subClassName)) { |
|
| 1121 | + if ( ! $calc->hasNode($subClassName)) { |
|
| 1122 | 1122 | $calc->addNode($targetSubClass->getClassName(), $targetSubClass); |
| 1123 | 1123 | |
| 1124 | 1124 | $newNodes[] = $targetSubClass; |
@@ -1194,7 +1194,7 @@ discard block |
||
| 1194 | 1194 | { |
| 1195 | 1195 | $oid = spl_object_id($entity); |
| 1196 | 1196 | |
| 1197 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
| 1197 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
| 1198 | 1198 | throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update'); |
| 1199 | 1199 | } |
| 1200 | 1200 | |
@@ -1202,7 +1202,7 @@ discard block |
||
| 1202 | 1202 | throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update'); |
| 1203 | 1203 | } |
| 1204 | 1204 | |
| 1205 | - if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1205 | + if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1206 | 1206 | $this->entityUpdates[$oid] = $entity; |
| 1207 | 1207 | } |
| 1208 | 1208 | } |
@@ -1278,7 +1278,7 @@ discard block |
||
| 1278 | 1278 | return; // entity has not been persisted yet, so nothing more to do. |
| 1279 | 1279 | } |
| 1280 | 1280 | |
| 1281 | - if (! $this->isInIdentityMap($entity)) { |
|
| 1281 | + if ( ! $this->isInIdentityMap($entity)) { |
|
| 1282 | 1282 | return; |
| 1283 | 1283 | } |
| 1284 | 1284 | |
@@ -1286,7 +1286,7 @@ discard block |
||
| 1286 | 1286 | |
| 1287 | 1287 | unset($this->entityUpdates[$oid]); |
| 1288 | 1288 | |
| 1289 | - if (! isset($this->entityDeletions[$oid])) { |
|
| 1289 | + if ( ! isset($this->entityDeletions[$oid])) { |
|
| 1290 | 1290 | $this->entityDeletions[$oid] = $entity; |
| 1291 | 1291 | $this->entityStates[$oid] = self::STATE_REMOVED; |
| 1292 | 1292 | } |
@@ -1388,7 +1388,7 @@ discard block |
||
| 1388 | 1388 | $persister = $this->getEntityPersister($class->getClassName()); |
| 1389 | 1389 | $id = $persister->getIdentifier($entity); |
| 1390 | 1390 | |
| 1391 | - if (! $id) { |
|
| 1391 | + if ( ! $id) { |
|
| 1392 | 1392 | return self::STATE_NEW; |
| 1393 | 1393 | } |
| 1394 | 1394 | |
@@ -1748,7 +1748,7 @@ discard block |
||
| 1748 | 1748 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1749 | 1749 | |
| 1750 | 1750 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1751 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1751 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1752 | 1752 | continue; |
| 1753 | 1753 | } |
| 1754 | 1754 | |
@@ -1795,7 +1795,7 @@ discard block |
||
| 1795 | 1795 | } |
| 1796 | 1796 | |
| 1797 | 1797 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1798 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1798 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1799 | 1799 | continue; |
| 1800 | 1800 | } |
| 1801 | 1801 | |
@@ -1811,7 +1811,7 @@ discard block |
||
| 1811 | 1811 | |
| 1812 | 1812 | case ($relatedEntities instanceof Collection): |
| 1813 | 1813 | case (is_array($relatedEntities)): |
| 1814 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1814 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1815 | 1815 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1816 | 1816 | $this->em->getClassMetadata($targetEntity), |
| 1817 | 1817 | $association, |
@@ -1826,7 +1826,7 @@ discard block |
||
| 1826 | 1826 | break; |
| 1827 | 1827 | |
| 1828 | 1828 | case ($relatedEntities !== null): |
| 1829 | - if (! $relatedEntities instanceof $targetEntity) { |
|
| 1829 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
| 1830 | 1830 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1831 | 1831 | $this->em->getClassMetadata($targetEntity), |
| 1832 | 1832 | $association, |
@@ -1855,7 +1855,7 @@ discard block |
||
| 1855 | 1855 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1856 | 1856 | |
| 1857 | 1857 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1858 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1858 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1859 | 1859 | continue; |
| 1860 | 1860 | } |
| 1861 | 1861 | |
@@ -1914,7 +1914,7 @@ discard block |
||
| 1914 | 1914 | |
| 1915 | 1915 | switch (true) { |
| 1916 | 1916 | case $lockMode === LockMode::OPTIMISTIC: |
| 1917 | - if (! $class->isVersioned()) { |
|
| 1917 | + if ( ! $class->isVersioned()) { |
|
| 1918 | 1918 | throw OptimisticLockException::notVersioned($class->getClassName()); |
| 1919 | 1919 | } |
| 1920 | 1920 | |
@@ -1937,7 +1937,7 @@ discard block |
||
| 1937 | 1937 | case $lockMode === LockMode::NONE: |
| 1938 | 1938 | case $lockMode === LockMode::PESSIMISTIC_READ: |
| 1939 | 1939 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
| 1940 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
| 1940 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 1941 | 1941 | throw TransactionRequiredException::transactionRequired(); |
| 1942 | 1942 | } |
| 1943 | 1943 | |
@@ -2096,7 +2096,7 @@ discard block |
||
| 2096 | 2096 | $entity->addPropertyChangedListener($this); |
| 2097 | 2097 | } |
| 2098 | 2098 | } else { |
| 2099 | - if (! isset($hints[Query::HINT_REFRESH]) |
|
| 2099 | + if ( ! isset($hints[Query::HINT_REFRESH]) |
|
| 2100 | 2100 | || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) { |
| 2101 | 2101 | return $entity; |
| 2102 | 2102 | } |
@@ -2144,7 +2144,7 @@ discard block |
||
| 2144 | 2144 | } |
| 2145 | 2145 | |
| 2146 | 2146 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
| 2147 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 2147 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 2148 | 2148 | continue; |
| 2149 | 2149 | } |
| 2150 | 2150 | |
@@ -2193,7 +2193,7 @@ discard block |
||
| 2193 | 2193 | continue; |
| 2194 | 2194 | } |
| 2195 | 2195 | |
| 2196 | - if (! $association->isOwningSide()) { |
|
| 2196 | + if ( ! $association->isOwningSide()) { |
|
| 2197 | 2197 | // use the given entity association |
| 2198 | 2198 | if (isset($data[$field]) && is_object($data[$field]) && |
| 2199 | 2199 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2243,7 +2243,7 @@ discard block |
||
| 2243 | 2243 | $associatedId[$targetField] = $joinColumnValue; |
| 2244 | 2244 | } |
| 2245 | 2245 | |
| 2246 | - if (! $associatedId) { |
|
| 2246 | + if ( ! $associatedId) { |
|
| 2247 | 2247 | // Foreign key is NULL |
| 2248 | 2248 | $association->setValue($entity, null); |
| 2249 | 2249 | $this->originalEntityData[$oid][$field] = null; |
@@ -2252,7 +2252,7 @@ discard block |
||
| 2252 | 2252 | } |
| 2253 | 2253 | |
| 2254 | 2254 | // @todo guilhermeblanco Can we remove the need of this somehow? |
| 2255 | - if (! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2255 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2256 | 2256 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
| 2257 | 2257 | } |
| 2258 | 2258 | |
@@ -2269,7 +2269,7 @@ discard block |
||
| 2269 | 2269 | // If this is an uninitialized proxy, we are deferring eager loads, |
| 2270 | 2270 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
| 2271 | 2271 | // then we can append this entity for eager loading! |
| 2272 | - if (! $targetClass->isIdentifierComposite() && |
|
| 2272 | + if ( ! $targetClass->isIdentifierComposite() && |
|
| 2273 | 2273 | $newValue instanceof GhostObjectInterface && |
| 2274 | 2274 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2275 | 2275 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2352,7 +2352,7 @@ discard block |
||
| 2352 | 2352 | |
| 2353 | 2353 | public function triggerEagerLoads() |
| 2354 | 2354 | { |
| 2355 | - if (! $this->eagerLoadingEntities) { |
|
| 2355 | + if ( ! $this->eagerLoadingEntities) { |
|
| 2356 | 2356 | return; |
| 2357 | 2357 | } |
| 2358 | 2358 | |
@@ -2361,7 +2361,7 @@ discard block |
||
| 2361 | 2361 | $this->eagerLoadingEntities = []; |
| 2362 | 2362 | |
| 2363 | 2363 | foreach ($eagerLoadingEntities as $entityName => $ids) { |
| 2364 | - if (! $ids) { |
|
| 2364 | + if ( ! $ids) { |
|
| 2365 | 2365 | continue; |
| 2366 | 2366 | } |
| 2367 | 2367 | |
@@ -2659,7 +2659,7 @@ discard block |
||
| 2659 | 2659 | { |
| 2660 | 2660 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 2661 | 2661 | |
| 2662 | - if (! $class->getProperty($propertyName)) { |
|
| 2662 | + if ( ! $class->getProperty($propertyName)) { |
|
| 2663 | 2663 | return; // ignore non-persistent fields |
| 2664 | 2664 | } |
| 2665 | 2665 | |
@@ -2668,7 +2668,7 @@ discard block |
||
| 2668 | 2668 | // Update changeset and mark entity for synchronization |
| 2669 | 2669 | $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; |
| 2670 | 2670 | |
| 2671 | - if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2671 | + if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2672 | 2672 | $this->scheduleForSynchronization($entity); |
| 2673 | 2673 | } |
| 2674 | 2674 | } |
@@ -2750,7 +2750,7 @@ discard block |
||
| 2750 | 2750 | */ |
| 2751 | 2751 | private static function objToStr($obj) |
| 2752 | 2752 | { |
| 2753 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
| 2753 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
| 2754 | 2754 | } |
| 2755 | 2755 | |
| 2756 | 2756 | /** |
@@ -2765,7 +2765,7 @@ discard block |
||
| 2765 | 2765 | */ |
| 2766 | 2766 | public function markReadOnly($object) |
| 2767 | 2767 | { |
| 2768 | - if (! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2768 | + if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2769 | 2769 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
| 2770 | 2770 | } |
| 2771 | 2771 | |
@@ -2783,7 +2783,7 @@ discard block |
||
| 2783 | 2783 | */ |
| 2784 | 2784 | public function isReadOnly($object) |
| 2785 | 2785 | { |
| 2786 | - if (! is_object($object)) { |
|
| 2786 | + if ( ! is_object($object)) { |
|
| 2787 | 2787 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
| 2788 | 2788 | } |
| 2789 | 2789 | |
@@ -2795,7 +2795,7 @@ discard block |
||
| 2795 | 2795 | */ |
| 2796 | 2796 | private function afterTransactionComplete() |
| 2797 | 2797 | { |
| 2798 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2798 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2799 | 2799 | $persister->afterTransactionComplete(); |
| 2800 | 2800 | }); |
| 2801 | 2801 | } |
@@ -2805,7 +2805,7 @@ discard block |
||
| 2805 | 2805 | */ |
| 2806 | 2806 | private function afterTransactionRolledBack() |
| 2807 | 2807 | { |
| 2808 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2808 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2809 | 2809 | $persister->afterTransactionRolledBack(); |
| 2810 | 2810 | }); |
| 2811 | 2811 | } |
@@ -2815,7 +2815,7 @@ discard block |
||
| 2815 | 2815 | */ |
| 2816 | 2816 | private function performCallbackOnCachedPersister(callable $callback) |
| 2817 | 2817 | { |
| 2818 | - if (! $this->hasCache) { |
|
| 2818 | + if ( ! $this->hasCache) { |
|
| 2819 | 2819 | return; |
| 2820 | 2820 | } |
| 2821 | 2821 | |
@@ -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 | |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | ) : Mapping\ClassMetadata { |
| 273 | 273 | $reflectionClass = $metadata->getReflectionClass(); |
| 274 | 274 | |
| 275 | - if (! $reflectionClass) { |
|
| 275 | + if ( ! $reflectionClass) { |
|
| 276 | 276 | // this happens when running annotation driver in combination with |
| 277 | 277 | // static reflection services. This is not the nicest fix |
| 278 | 278 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | ); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - if (! $property) { |
|
| 320 | + if ( ! $property) { |
|
| 321 | 321 | continue; |
| 322 | 322 | } |
| 323 | 323 | |
@@ -610,12 +610,12 @@ discard block |
||
| 610 | 610 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 611 | 611 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 612 | 612 | |
| 613 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 613 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 614 | 614 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 615 | 615 | $assocMetadata->setOwningSide(false); |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 618 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 619 | 619 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 620 | 620 | } |
| 621 | 621 | |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 673 | 673 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 674 | 674 | |
| 675 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 675 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 676 | 676 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 677 | 677 | } |
| 678 | 678 | |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | $assocMetadata->setOwningSide(false); |
| 733 | 733 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 734 | 734 | |
| 735 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 735 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 736 | 736 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 737 | 737 | } |
| 738 | 738 | |
@@ -774,16 +774,16 @@ discard block |
||
| 774 | 774 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 775 | 775 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 776 | 776 | |
| 777 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 777 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 778 | 778 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 779 | 779 | $assocMetadata->setOwningSide(false); |
| 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 $tableMetadata |
| 860 | 860 | ) : void { |
| 861 | - if (! empty($tableAnnot->name)) { |
|
| 861 | + if ( ! empty($tableAnnot->name)) { |
|
| 862 | 862 | $tableMetadata->setName($tableAnnot->name); |
| 863 | 863 | } |
| 864 | 864 | |
| 865 | - if (! empty($tableAnnot->schema)) { |
|
| 865 | + if ( ! empty($tableAnnot->schema)) { |
|
| 866 | 866 | $tableMetadata->setSchema($tableAnnot->schema); |
| 867 | 867 | } |
| 868 | 868 | |
@@ -898,11 +898,11 @@ discard block |
||
| 898 | 898 | ) : Mapping\JoinTableMetadata { |
| 899 | 899 | $joinTable = new Mapping\JoinTableMetadata(); |
| 900 | 900 | |
| 901 | - if (! empty($joinTableAnnot->name)) { |
|
| 901 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 902 | 902 | $joinTable->setName($joinTableAnnot->name); |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | - if (! empty($joinTableAnnot->schema)) { |
|
| 905 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 906 | 906 | $joinTable->setSchema($joinTableAnnot->schema); |
| 907 | 907 | } |
| 908 | 908 | |
@@ -930,22 +930,22 @@ discard block |
||
| 930 | 930 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 931 | 931 | |
| 932 | 932 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 933 | - if (! empty($joinColumnAnnot->name)) { |
|
| 933 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 934 | 934 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 937 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 938 | 938 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 939 | 939 | } |
| 940 | 940 | |
| 941 | 941 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 942 | 942 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 943 | 943 | |
| 944 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 944 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 945 | 945 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 946 | 946 | } |
| 947 | 947 | |
| 948 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 948 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 949 | 949 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 950 | 950 | } |
| 951 | 951 | |
@@ -967,7 +967,7 @@ discard block |
||
| 967 | 967 | $fieldName = null |
| 968 | 968 | ) : Mapping\CacheMetadata { |
| 969 | 969 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 970 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 970 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 971 | 971 | |
| 972 | 972 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 973 | 973 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -989,7 +989,7 @@ discard block |
||
| 989 | 989 | if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) { |
| 990 | 990 | // Handle the case where a middle mapped super class inherits from a single table inheritance tree. |
| 991 | 991 | do { |
| 992 | - if (! $parent->isMappedSuperclass) { |
|
| 992 | + if ( ! $parent->isMappedSuperclass) { |
|
| 993 | 993 | $metadata->setTable($parent->table); |
| 994 | 994 | |
| 995 | 995 | break; |
@@ -1044,11 +1044,11 @@ discard block |
||
| 1044 | 1044 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1045 | 1045 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1046 | 1046 | |
| 1047 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1047 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1048 | 1048 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1051 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1052 | 1052 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1053 | 1053 | } |
| 1054 | 1054 | } |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1101 | 1101 | |
| 1102 | 1102 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1103 | - if (! class_exists($listenerClassName)) { |
|
| 1103 | + if ( ! class_exists($listenerClassName)) { |
|
| 1104 | 1104 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1105 | 1105 | $listenerClassName, |
| 1106 | 1106 | $metadata->getClassName() |
@@ -1137,7 +1137,7 @@ discard block |
||
| 1137 | 1137 | $fieldName = $associationOverride->name; |
| 1138 | 1138 | $property = $metadata->getProperty($fieldName); |
| 1139 | 1139 | |
| 1140 | - if (! $property) { |
|
| 1140 | + if ( ! $property) { |
|
| 1141 | 1141 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1142 | 1142 | } |
| 1143 | 1143 | |
@@ -1171,7 +1171,7 @@ discard block |
||
| 1171 | 1171 | // Check for fetch |
| 1172 | 1172 | if ($associationOverride->fetch) { |
| 1173 | 1173 | $override->setFetchMode( |
| 1174 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1174 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1175 | 1175 | ); |
| 1176 | 1176 | } |
| 1177 | 1177 | |
@@ -1260,7 +1260,7 @@ discard block |
||
| 1260 | 1260 | { |
| 1261 | 1261 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1262 | 1262 | |
| 1263 | - if (! defined($fetchModeConstant)) { |
|
| 1263 | + if ( ! defined($fetchModeConstant)) { |
|
| 1264 | 1264 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1265 | 1265 | } |
| 1266 | 1266 | |
@@ -1306,7 +1306,7 @@ discard block |
||
| 1306 | 1306 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1307 | 1307 | |
| 1308 | 1308 | foreach ($classAnnotations as $key => $annot) { |
| 1309 | - if (! is_numeric($key)) { |
|
| 1309 | + if ( ! is_numeric($key)) { |
|
| 1310 | 1310 | continue; |
| 1311 | 1311 | } |
| 1312 | 1312 | |
@@ -1324,7 +1324,7 @@ discard block |
||
| 1324 | 1324 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1325 | 1325 | |
| 1326 | 1326 | foreach ($propertyAnnotations as $key => $annot) { |
| 1327 | - if (! is_numeric($key)) { |
|
| 1327 | + if ( ! is_numeric($key)) { |
|
| 1328 | 1328 | continue; |
| 1329 | 1329 | } |
| 1330 | 1330 | |
@@ -1342,7 +1342,7 @@ discard block |
||
| 1342 | 1342 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1343 | 1343 | |
| 1344 | 1344 | foreach ($methodAnnotations as $key => $annot) { |
| 1345 | - if (! is_numeric($key)) { |
|
| 1345 | + if ( ! is_numeric($key)) { |
|
| 1346 | 1346 | continue; |
| 1347 | 1347 | } |
| 1348 | 1348 | |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | $result = $this->loadMappingFile($this->locator->findMappingFile($className)); |
| 110 | - if (! isset($result[$className])) { |
|
| 111 | - throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension()); |
|
| 110 | + if ( ! isset($result[$className])) { |
|
| 111 | + throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className).$this->locator->getFileExtension()); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | $this->classCache[$className] = $result[$className]; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $this->initialize(); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if (! $this->classCache) { |
|
| 144 | + if ( ! $this->classCache) { |
|
| 145 | 145 | return (array) $this->locator->getAllClassNames($this->globalBasename); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $this->classCache = []; |
| 176 | 176 | if ($this->globalBasename !== null) { |
| 177 | 177 | foreach ($this->locator->getPaths() as $path) { |
| 178 | - $file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension(); |
|
| 178 | + $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); |
|
| 179 | 179 | if (is_file($file)) { |
| 180 | 180 | $this->classCache = array_merge( |
| 181 | 181 | $this->classCache, |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | $classNames = array_filter( |
| 138 | 138 | $this->locator->getAllClassNames(null), |
| 139 | - function ($className) { |
|
| 139 | + function($className) { |
|
| 140 | 140 | return ! $this->isTransient($className); |
| 141 | 141 | } |
| 142 | 142 | ); |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 255 | 255 | |
| 256 | 256 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 257 | - if (! class_exists($listenerClassName)) { |
|
| 257 | + if ( ! class_exists($listenerClassName)) { |
|
| 258 | 258 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 259 | 259 | $listenerClassName, |
| 260 | 260 | $reflectionClass->getName() |
@@ -301,15 +301,15 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $discriminatorColumn->setColumnName($discriminatorColumnAnnot->name); |
| 303 | 303 | |
| 304 | - if (! empty($discriminatorColumnAnnot->columnDefinition)) { |
|
| 304 | + if ( ! empty($discriminatorColumnAnnot->columnDefinition)) { |
|
| 305 | 305 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnot->columnDefinition); |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | - if (! empty($discriminatorColumnAnnot->type)) { |
|
| 308 | + if ( ! empty($discriminatorColumnAnnot->type)) { |
|
| 309 | 309 | $discriminatorColumn->setType(Type::getType($discriminatorColumnAnnot->type)); |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | - if (! empty($discriminatorColumnAnnot->length)) { |
|
| 312 | + if ( ! empty($discriminatorColumnAnnot->length)) { |
|
| 313 | 313 | $discriminatorColumn->setLength($discriminatorColumnAnnot->length); |
| 314 | 314 | } |
| 315 | 315 | } |
@@ -364,11 +364,11 @@ discard block |
||
| 364 | 364 | { |
| 365 | 365 | $table = new Mapping\TableMetadata(); |
| 366 | 366 | |
| 367 | - if (! empty($tableAnnot->name)) { |
|
| 367 | + if ( ! empty($tableAnnot->name)) { |
|
| 368 | 368 | $table->setName($tableAnnot->name); |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | - if (! empty($tableAnnot->schema)) { |
|
| 371 | + if ( ! empty($tableAnnot->schema)) { |
|
| 372 | 372 | $table->setSchema($tableAnnot->schema); |
| 373 | 373 | } |
| 374 | 374 | |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | ) { |
| 413 | 413 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 414 | 414 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 415 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 415 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 416 | 416 | |
| 417 | 417 | return new Mapping\CacheMetadata($usage, $cacheAnnot->region ?: $defaultRegion); |
| 418 | 418 | } |
@@ -528,11 +528,11 @@ discard block |
||
| 528 | 528 | $fieldMetadata->setPrimaryKey(true); |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 531 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 532 | 532 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | - if (! empty($columnAnnot->length)) { |
|
| 535 | + if ( ! empty($columnAnnot->length)) { |
|
| 536 | 536 | $fieldMetadata->setLength($columnAnnot->length); |
| 537 | 537 | } |
| 538 | 538 | |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | break; |
| 554 | 554 | |
| 555 | 555 | default: |
| 556 | - if (! isset($customOptions['default'])) { |
|
| 556 | + if ( ! isset($customOptions['default'])) { |
|
| 557 | 557 | throw Mapping\MappingException::unsupportedOptimisticLockingType($fieldMetadata->getType()); |
| 558 | 558 | } |
| 559 | 559 | } |
@@ -591,11 +591,11 @@ discard block |
||
| 591 | 591 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 592 | 592 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 593 | 593 | |
| 594 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 594 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 595 | 595 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 596 | 596 | } |
| 597 | 597 | |
| 598 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 598 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 599 | 599 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 600 | 600 | } |
| 601 | 601 | |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 672 | 672 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 673 | 673 | |
| 674 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 674 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 675 | 675 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 676 | 676 | } |
| 677 | 677 | |
@@ -748,11 +748,11 @@ discard block |
||
| 748 | 748 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 749 | 749 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 750 | 750 | |
| 751 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 751 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 752 | 752 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 753 | 753 | } |
| 754 | 754 | |
| 755 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 755 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 756 | 756 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 757 | 757 | } |
| 758 | 758 | |
@@ -806,15 +806,15 @@ discard block |
||
| 806 | 806 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 807 | 807 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 808 | 808 | |
| 809 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 809 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 810 | 810 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 813 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 814 | 814 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 817 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 818 | 818 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 819 | 819 | } |
| 820 | 820 | |
@@ -865,11 +865,11 @@ discard block |
||
| 865 | 865 | ) { |
| 866 | 866 | $joinTable = new Mapping\JoinTableMetadata(); |
| 867 | 867 | |
| 868 | - if (! empty($joinTableAnnot->name)) { |
|
| 868 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 869 | 869 | $joinTable->setName($joinTableAnnot->name); |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | - if (! empty($joinTableAnnot->schema)) { |
|
| 872 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 873 | 873 | $joinTable->setSchema($joinTableAnnot->schema); |
| 874 | 874 | } |
| 875 | 875 | |
@@ -922,11 +922,11 @@ discard block |
||
| 922 | 922 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 923 | 923 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 924 | 924 | |
| 925 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 925 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 926 | 926 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 927 | 927 | } |
| 928 | 928 | |
| 929 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 929 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 930 | 930 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 931 | 931 | } |
| 932 | 932 | |
@@ -982,7 +982,7 @@ discard block |
||
| 982 | 982 | { |
| 983 | 983 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 984 | 984 | |
| 985 | - if (! defined($fetchModeConstant)) { |
|
| 985 | + if ( ! defined($fetchModeConstant)) { |
|
| 986 | 986 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 987 | 987 | } |
| 988 | 988 | |
@@ -1024,7 +1024,7 @@ discard block |
||
| 1024 | 1024 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1025 | 1025 | |
| 1026 | 1026 | foreach ($classAnnotations as $key => $annot) { |
| 1027 | - if (! is_numeric($key)) { |
|
| 1027 | + if ( ! is_numeric($key)) { |
|
| 1028 | 1028 | continue; |
| 1029 | 1029 | } |
| 1030 | 1030 | |
@@ -1042,7 +1042,7 @@ discard block |
||
| 1042 | 1042 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1043 | 1043 | |
| 1044 | 1044 | foreach ($propertyAnnotations as $key => $annot) { |
| 1045 | - if (! is_numeric($key)) { |
|
| 1045 | + if ( ! is_numeric($key)) { |
|
| 1046 | 1046 | continue; |
| 1047 | 1047 | } |
| 1048 | 1048 | |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1061 | 1061 | |
| 1062 | 1062 | foreach ($methodAnnotations as $key => $annot) { |
| 1063 | - if (! is_numeric($key)) { |
|
| 1063 | + if ( ! is_numeric($key)) { |
|
| 1064 | 1064 | continue; |
| 1065 | 1065 | } |
| 1066 | 1066 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | return $this->classNames; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - if (! $this->paths) { |
|
| 200 | + if ( ! $this->paths) { |
|
| 201 | 201 | throw Mapping\MappingException::pathRequired(); |
| 202 | 202 | } |
| 203 | 203 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $includedFiles = []; |
| 206 | 206 | |
| 207 | 207 | foreach ($this->paths as $path) { |
| 208 | - if (! is_dir($path)) { |
|
| 208 | + if ( ! is_dir($path)) { |
|
| 209 | 209 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 210 | 210 | } |
| 211 | 211 | |
@@ -214,14 +214,14 @@ discard block |
||
| 214 | 214 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
| 215 | 215 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 216 | 216 | ), |
| 217 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 217 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 218 | 218 | \RecursiveRegexIterator::GET_MATCH |
| 219 | 219 | ); |
| 220 | 220 | |
| 221 | 221 | foreach ($iterator as $file) { |
| 222 | 222 | $sourceFile = $file[0]; |
| 223 | 223 | |
| 224 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
| 224 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
| 225 | 225 | $sourceFile = realpath($sourceFile); |
| 226 | 226 | } |
| 227 | 227 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | ) : Mapping\ClassMetadata { |
| 270 | 270 | $reflectionClass = $metadata->getReflectionClass(); |
| 271 | 271 | |
| 272 | - if (! $reflectionClass) { |
|
| 272 | + if ( ! $reflectionClass) { |
|
| 273 | 273 | // this happens when running annotation driver in combination with |
| 274 | 274 | // static reflection services. This is not the nicest fix |
| 275 | 275 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | $metadataBuildingContext |
| 307 | 307 | ); |
| 308 | 308 | |
| 309 | - if (! $property) { |
|
| 309 | + if ( ! $property) { |
|
| 310 | 310 | continue; |
| 311 | 311 | } |
| 312 | 312 | |
@@ -603,11 +603,11 @@ discard block |
||
| 603 | 603 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 604 | 604 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 605 | 605 | |
| 606 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 606 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 607 | 607 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 610 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 611 | 611 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 612 | 612 | } |
| 613 | 613 | |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 666 | 666 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 667 | 667 | |
| 668 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 668 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 669 | 669 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 670 | 670 | } |
| 671 | 671 | |
@@ -724,11 +724,11 @@ discard block |
||
| 724 | 724 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 725 | 725 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 726 | 726 | |
| 727 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 727 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 728 | 728 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 731 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 732 | 732 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 733 | 733 | } |
| 734 | 734 | |
@@ -771,15 +771,15 @@ discard block |
||
| 771 | 771 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 772 | 772 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 773 | 773 | |
| 774 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 774 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 775 | 775 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 776 | 776 | } |
| 777 | 777 | |
| 778 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 778 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 779 | 779 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 782 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 783 | 783 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 784 | 784 | } |
| 785 | 785 | |
@@ -823,15 +823,15 @@ discard block |
||
| 823 | 823 | |
| 824 | 824 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 825 | 825 | |
| 826 | - if (! empty($columnAnnot->name)) { |
|
| 826 | + if ( ! empty($columnAnnot->name)) { |
|
| 827 | 827 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 828 | 828 | } |
| 829 | 829 | |
| 830 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 830 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 831 | 831 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 832 | 832 | } |
| 833 | 833 | |
| 834 | - if (! empty($columnAnnot->length)) { |
|
| 834 | + if ( ! empty($columnAnnot->length)) { |
|
| 835 | 835 | $fieldMetadata->setLength($columnAnnot->length); |
| 836 | 836 | } |
| 837 | 837 | |
@@ -854,11 +854,11 @@ discard block |
||
| 854 | 854 | Annotation\Table $tableAnnot, |
| 855 | 855 | Mapping\TableMetadata $table |
| 856 | 856 | ) : Mapping\TableMetadata { |
| 857 | - if (! empty($tableAnnot->name)) { |
|
| 857 | + if ( ! empty($tableAnnot->name)) { |
|
| 858 | 858 | $table->setName($tableAnnot->name); |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | - if (! empty($tableAnnot->schema)) { |
|
| 861 | + if ( ! empty($tableAnnot->schema)) { |
|
| 862 | 862 | $table->setSchema($tableAnnot->schema); |
| 863 | 863 | } |
| 864 | 864 | |
@@ -896,11 +896,11 @@ discard block |
||
| 896 | 896 | ) : Mapping\JoinTableMetadata { |
| 897 | 897 | $joinTable = new Mapping\JoinTableMetadata(); |
| 898 | 898 | |
| 899 | - if (! empty($joinTableAnnot->name)) { |
|
| 899 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 900 | 900 | $joinTable->setName($joinTableAnnot->name); |
| 901 | 901 | } |
| 902 | 902 | |
| 903 | - if (! empty($joinTableAnnot->schema)) { |
|
| 903 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 904 | 904 | $joinTable->setSchema($joinTableAnnot->schema); |
| 905 | 905 | } |
| 906 | 906 | |
@@ -928,22 +928,22 @@ discard block |
||
| 928 | 928 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 929 | 929 | |
| 930 | 930 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 931 | - if (! empty($joinColumnAnnot->name)) { |
|
| 931 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 932 | 932 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 933 | 933 | } |
| 934 | 934 | |
| 935 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 935 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 936 | 936 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | 939 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 940 | 940 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 941 | 941 | |
| 942 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 942 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 943 | 943 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 944 | 944 | } |
| 945 | 945 | |
| 946 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 946 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 947 | 947 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 948 | 948 | } |
| 949 | 949 | |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | $fieldName = null |
| 966 | 966 | ) : Mapping\CacheMetadata { |
| 967 | 967 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 968 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 968 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 969 | 969 | |
| 970 | 970 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 971 | 971 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1034,11 +1034,11 @@ discard block |
||
| 1034 | 1034 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1035 | 1035 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1036 | 1036 | |
| 1037 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1037 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1038 | 1038 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1039 | 1039 | } |
| 1040 | 1040 | |
| 1041 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1041 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1042 | 1042 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1043 | 1043 | } |
| 1044 | 1044 | } |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1091 | 1091 | |
| 1092 | 1092 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1093 | - if (! class_exists($listenerClassName)) { |
|
| 1093 | + if ( ! class_exists($listenerClassName)) { |
|
| 1094 | 1094 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1095 | 1095 | $listenerClassName, |
| 1096 | 1096 | $metadata->getClassName() |
@@ -1128,7 +1128,7 @@ discard block |
||
| 1128 | 1128 | $fieldName = $associationOverride->name; |
| 1129 | 1129 | $property = $metadata->getProperty($fieldName); |
| 1130 | 1130 | |
| 1131 | - if (! $property) { |
|
| 1131 | + if ( ! $property) { |
|
| 1132 | 1132 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1133 | 1133 | } |
| 1134 | 1134 | |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | // Check for fetch |
| 1163 | 1163 | if ($associationOverride->fetch) { |
| 1164 | 1164 | $override->setFetchMode( |
| 1165 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1165 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1166 | 1166 | ); |
| 1167 | 1167 | } |
| 1168 | 1168 | |
@@ -1251,7 +1251,7 @@ discard block |
||
| 1251 | 1251 | { |
| 1252 | 1252 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1253 | 1253 | |
| 1254 | - if (! defined($fetchModeConstant)) { |
|
| 1254 | + if ( ! defined($fetchModeConstant)) { |
|
| 1255 | 1255 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1256 | 1256 | } |
| 1257 | 1257 | |
@@ -1297,7 +1297,7 @@ discard block |
||
| 1297 | 1297 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1298 | 1298 | |
| 1299 | 1299 | foreach ($classAnnotations as $key => $annot) { |
| 1300 | - if (! is_numeric($key)) { |
|
| 1300 | + if ( ! is_numeric($key)) { |
|
| 1301 | 1301 | continue; |
| 1302 | 1302 | } |
| 1303 | 1303 | |
@@ -1315,7 +1315,7 @@ discard block |
||
| 1315 | 1315 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1316 | 1316 | |
| 1317 | 1317 | foreach ($propertyAnnotations as $key => $annot) { |
| 1318 | - if (! is_numeric($key)) { |
|
| 1318 | + if ( ! is_numeric($key)) { |
|
| 1319 | 1319 | continue; |
| 1320 | 1320 | } |
| 1321 | 1321 | |
@@ -1333,7 +1333,7 @@ discard block |
||
| 1333 | 1333 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1334 | 1334 | |
| 1335 | 1335 | foreach ($methodAnnotations as $key => $annot) { |
| 1336 | - if (! is_numeric($key)) { |
|
| 1336 | + if ( ! is_numeric($key)) { |
|
| 1337 | 1337 | continue; |
| 1338 | 1338 | } |
| 1339 | 1339 | |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | foreach ($this->drivers as $namespace => $driver) { |
| 100 | 100 | $oid = spl_object_id($driver); |
| 101 | 101 | |
| 102 | - if (! isset($driverClasses[$oid])) { |
|
| 102 | + if ( ! isset($driverClasses[$oid])) { |
|
| 103 | 103 | $driverClasses[$oid] = $driver->getAllClassNames(); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -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 | } |
@@ -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 | ); |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | |
| 414 | 414 | if (isset($manyToOneElement['fetch'])) { |
| 415 | 415 | $association->setFetchMode( |
| 416 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
| 416 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
| 417 | 417 | ); |
| 418 | 418 | } |
| 419 | 419 | |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | $fieldName = (string) $overrideElement['name']; |
| 567 | 567 | $property = $metadata->getProperty($fieldName); |
| 568 | 568 | |
| 569 | - if (! $property) { |
|
| 569 | + if ( ! $property) { |
|
| 570 | 570 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 571 | 571 | } |
| 572 | 572 | |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | // Check for fetch |
| 625 | 625 | if (isset($overrideElement['fetch'])) { |
| 626 | 626 | $override->setFetchMode( |
| 627 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
| 627 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
| 628 | 628 | ); |
| 629 | 629 | } |
| 630 | 630 | |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | // Evaluate <lifecycle-callbacks...> |
| 636 | 636 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
| 637 | 637 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
| 638 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
| 638 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
| 639 | 639 | $methodName = (string) $lifecycleCallback['method']; |
| 640 | 640 | |
| 641 | 641 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
| 648 | 648 | $listenerClassName = (string) $listenerElement['class']; |
| 649 | 649 | |
| 650 | - if (! class_exists($listenerClassName)) { |
|
| 650 | + if ( ! class_exists($listenerClassName)) { |
|
| 651 | 651 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 652 | 652 | $listenerClassName, |
| 653 | 653 | $metadata->getClassName() |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | $fieldName = null |
| 815 | 815 | ) { |
| 816 | 816 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 817 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 817 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 818 | 818 | |
| 819 | 819 | $region = (string) ($cacheMapping['region'] ?? $defaultRegion); |
| 820 | 820 | $usage = isset($cacheMapping['usage']) |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | Events::preFlush, |
| 844 | 844 | ]; |
| 845 | 845 | |
| 846 | - return array_filter($events, function ($eventName) use ($method) { |
|
| 846 | + return array_filter($events, function($eventName) use ($method) { |
|
| 847 | 847 | return $eventName === $method->getName(); |
| 848 | 848 | }); |
| 849 | 849 | } |