@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | $state = $this->getEntityState($entity); |
500 | 500 | |
501 | 501 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
502 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
502 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | $oid = spl_object_hash($entity); |
556 | 556 | $data = []; |
557 | 557 | |
558 | - if (!isset($this->entityChangeSets[$oid])) { |
|
558 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
559 | 559 | return $data; |
560 | 560 | } |
561 | 561 | |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | if ($owner === null) { // cloned |
719 | 719 | $actualValue->setOwner($entity, $assoc); |
720 | 720 | } else if ($owner !== $entity) { // no clone, we have to fix |
721 | - if (!$actualValue->isInitialized()) { |
|
721 | + if ( ! $actualValue->isInitialized()) { |
|
722 | 722 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
723 | 723 | } |
724 | 724 | $newValue = clone $actualValue; |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
865 | 865 | |
866 | 866 | foreach ($unwrappedValue as $key => $entry) { |
867 | - if (! ($entry instanceof $targetClass->name)) { |
|
867 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
868 | 868 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
869 | 869 | } |
870 | 870 | |
@@ -942,7 +942,7 @@ discard block |
||
942 | 942 | |
943 | 943 | // Some identifiers may be foreign keys to new entities. |
944 | 944 | // In this case, we don't have the value yet and should treat it as if we have a post-insert generator |
945 | - if (! $this->hasMissingIdsWhichAreForeignKeys($class, $idValue)) { |
|
945 | + if ( ! $this->hasMissingIdsWhichAreForeignKeys($class, $idValue)) { |
|
946 | 946 | $this->entityIdentifiers[$oid] = $idValue; |
947 | 947 | } |
948 | 948 | } |
@@ -1091,7 +1091,7 @@ discard block |
||
1091 | 1091 | } |
1092 | 1092 | } else { |
1093 | 1093 | foreach ($insertionsForClass as $oid => $entity) { |
1094 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
1094 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
1095 | 1095 | //entity was not added to identity map because some identifiers are foreign keys to new entities. |
1096 | 1096 | //add it now |
1097 | 1097 | $this->addToEntityIdentifiersAndEntityMap($class, $oid, $entity); |
@@ -1783,7 +1783,7 @@ discard block |
||
1783 | 1783 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
1784 | 1784 | |
1785 | 1785 | default: |
1786 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1786 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1787 | 1787 | } |
1788 | 1788 | |
1789 | 1789 | $this->cascadePersist($entity, $visited); |
@@ -1853,7 +1853,7 @@ discard block |
||
1853 | 1853 | case self::STATE_DETACHED: |
1854 | 1854 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
1855 | 1855 | default: |
1856 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1856 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1857 | 1857 | } |
1858 | 1858 | |
1859 | 1859 | } |
@@ -1992,7 +1992,7 @@ discard block |
||
1992 | 1992 | */ |
1993 | 1993 | private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy) |
1994 | 1994 | { |
1995 | - if (! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
1995 | + if ( ! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
1996 | 1996 | return; |
1997 | 1997 | } |
1998 | 1998 | |
@@ -2017,7 +2017,7 @@ discard block |
||
2017 | 2017 | */ |
2018 | 2018 | private function isLoaded($entity) |
2019 | 2019 | { |
2020 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
2020 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
2021 | 2021 | } |
2022 | 2022 | |
2023 | 2023 | /** |
@@ -2175,7 +2175,7 @@ discard block |
||
2175 | 2175 | |
2176 | 2176 | $associationMappings = array_filter( |
2177 | 2177 | $class->associationMappings, |
2178 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
2178 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
2179 | 2179 | ); |
2180 | 2180 | |
2181 | 2181 | foreach ($associationMappings as $assoc) { |
@@ -2218,7 +2218,7 @@ discard block |
||
2218 | 2218 | |
2219 | 2219 | $associationMappings = array_filter( |
2220 | 2220 | $class->associationMappings, |
2221 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
2221 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
2222 | 2222 | ); |
2223 | 2223 | |
2224 | 2224 | foreach ($associationMappings as $assoc) { |
@@ -2262,7 +2262,7 @@ discard block |
||
2262 | 2262 | |
2263 | 2263 | $associationMappings = array_filter( |
2264 | 2264 | $class->associationMappings, |
2265 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
2265 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
2266 | 2266 | ); |
2267 | 2267 | |
2268 | 2268 | foreach ($associationMappings as $assoc) { |
@@ -2301,7 +2301,7 @@ discard block |
||
2301 | 2301 | |
2302 | 2302 | $associationMappings = array_filter( |
2303 | 2303 | $class->associationMappings, |
2304 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
2304 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
2305 | 2305 | ); |
2306 | 2306 | |
2307 | 2307 | foreach ($associationMappings as $assoc) { |
@@ -2330,7 +2330,7 @@ discard block |
||
2330 | 2330 | break; |
2331 | 2331 | |
2332 | 2332 | case ($relatedEntities !== null): |
2333 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2333 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2334 | 2334 | throw ORMInvalidArgumentException::invalidAssociation( |
2335 | 2335 | $this->em->getClassMetadata($assoc['targetEntity']), |
2336 | 2336 | $assoc, |
@@ -2361,13 +2361,13 @@ discard block |
||
2361 | 2361 | |
2362 | 2362 | $associationMappings = array_filter( |
2363 | 2363 | $class->associationMappings, |
2364 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
2364 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
2365 | 2365 | ); |
2366 | 2366 | |
2367 | 2367 | $entitiesToCascade = []; |
2368 | 2368 | |
2369 | 2369 | foreach ($associationMappings as $assoc) { |
2370 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2370 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2371 | 2371 | $entity->__load(); |
2372 | 2372 | } |
2373 | 2373 | |
@@ -2431,7 +2431,7 @@ discard block |
||
2431 | 2431 | return; |
2432 | 2432 | } |
2433 | 2433 | |
2434 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2434 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2435 | 2435 | $entity->__load(); |
2436 | 2436 | } |
2437 | 2437 | |
@@ -2446,7 +2446,7 @@ discard block |
||
2446 | 2446 | case LockMode::NONE === $lockMode: |
2447 | 2447 | case LockMode::PESSIMISTIC_READ === $lockMode: |
2448 | 2448 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
2449 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
2449 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
2450 | 2450 | throw TransactionRequiredException::transactionRequired(); |
2451 | 2451 | } |
2452 | 2452 | |
@@ -2770,7 +2770,7 @@ discard block |
||
2770 | 2770 | // then we can append this entity for eager loading! |
2771 | 2771 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
2772 | 2772 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2773 | - !$targetClass->isIdentifierComposite && |
|
2773 | + ! $targetClass->isIdentifierComposite && |
|
2774 | 2774 | $newValue instanceof Proxy && |
2775 | 2775 | $newValue->__isInitialized__ === false) { |
2776 | 2776 | |
@@ -3135,7 +3135,7 @@ discard block |
||
3135 | 3135 | public function getCollectionPersister(array $association) |
3136 | 3136 | { |
3137 | 3137 | $role = isset($association['cache']) |
3138 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
3138 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
3139 | 3139 | : $association['type']; |
3140 | 3140 | |
3141 | 3141 | if (isset($this->collectionPersisters[$role])) { |
@@ -3353,7 +3353,7 @@ discard block |
||
3353 | 3353 | */ |
3354 | 3354 | private function afterTransactionComplete() |
3355 | 3355 | { |
3356 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
3356 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
3357 | 3357 | $persister->afterTransactionComplete(); |
3358 | 3358 | }); |
3359 | 3359 | } |
@@ -3363,7 +3363,7 @@ discard block |
||
3363 | 3363 | */ |
3364 | 3364 | private function afterTransactionRolledBack() |
3365 | 3365 | { |
3366 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
3366 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
3367 | 3367 | $persister->afterTransactionRolledBack(); |
3368 | 3368 | }); |
3369 | 3369 | } |
@@ -3459,11 +3459,11 @@ discard block |
||
3459 | 3459 | */ |
3460 | 3460 | private function mergeEntityStateIntoManagedCopy($entity, $managedCopy) |
3461 | 3461 | { |
3462 | - if (! $this->isLoaded($entity)) { |
|
3462 | + if ( ! $this->isLoaded($entity)) { |
|
3463 | 3463 | return; |
3464 | 3464 | } |
3465 | 3465 | |
3466 | - if (! $this->isLoaded($managedCopy)) { |
|
3466 | + if ( ! $this->isLoaded($managedCopy)) { |
|
3467 | 3467 | $managedCopy->__load(); |
3468 | 3468 | } |
3469 | 3469 | |
@@ -3486,7 +3486,7 @@ discard block |
||
3486 | 3486 | if ($other === null) { |
3487 | 3487 | $prop->setValue($managedCopy, null); |
3488 | 3488 | } else { |
3489 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
3489 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
3490 | 3490 | // do not merge fields marked lazy that have not been fetched. |
3491 | 3491 | continue; |
3492 | 3492 | } |
@@ -3573,7 +3573,7 @@ discard block |
||
3573 | 3573 | */ |
3574 | 3574 | private function clearIdentityMapForEntityName($entityName) |
3575 | 3575 | { |
3576 | - if (! isset($this->identityMap[$entityName])) { |
|
3576 | + if ( ! isset($this->identityMap[$entityName])) { |
|
3577 | 3577 | return; |
3578 | 3578 | } |
3579 | 3579 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $this->_em->getClassMetadata(OwningSide::class), |
21 | 21 | $this->_em->getClassMetadata(InverseSide::class), |
22 | 22 | ]); |
23 | - } catch(ToolsException $e) { |
|
23 | + } catch (ToolsException $e) { |
|
24 | 24 | // ignored |
25 | 25 | } |
26 | 26 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $query = $this->_em->createQuery( |
38 | 38 | 'SELECT CONCAT(e.type, MIN(e.version)) pair' |
39 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
39 | + . ' FROM '.GH7286Entity::class.' e' |
|
40 | 40 | . ' WHERE e.type IS NOT NULL' |
41 | 41 | . ' GROUP BY e.type' |
42 | 42 | . ' ORDER BY e.type' |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $query = $this->_em->createQuery( |
62 | 62 | 'SELECT CC(e.type, MIN(e.version)) pair' |
63 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
63 | + . ' FROM '.GH7286Entity::class.' e' |
|
64 | 64 | . ' WHERE e.type IS NOT NULL AND e.type != :type' |
65 | 65 | . ' GROUP BY e.type' |
66 | 66 | ); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | protected function _loadDriver() |
22 | 22 | { |
23 | - return new XmlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'xml'); |
|
23 | + return new XmlDriver(__DIR__.DIRECTORY_SEPARATOR.'xml'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function testClassTableInheritanceDiscriminatorMap() |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function testValidateXmlSchema($xmlMappingFile) |
154 | 154 | { |
155 | - $xsdSchemaFile = __DIR__ . '/../../../../../doctrine-mapping.xsd'; |
|
155 | + $xsdSchemaFile = __DIR__.'/../../../../../doctrine-mapping.xsd'; |
|
156 | 156 | $dom = new \DOMDocument(); |
157 | 157 | |
158 | 158 | $dom->load($xmlMappingFile); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | static public function dataValidSchema() |
164 | 164 | { |
165 | - $list = glob(__DIR__ . '/xml/*.xml'); |
|
165 | + $list = glob(__DIR__.'/xml/*.xml'); |
|
166 | 166 | $invalid = [ |
167 | 167 | 'Doctrine.Tests.Models.DDC889.DDC889Class.dcm' |
168 | 168 | ]; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | return ! in_array(pathinfo($item, PATHINFO_FILENAME), $invalid); |
172 | 172 | }); |
173 | 173 | |
174 | - return array_map(function($item){ |
|
174 | + return array_map(function($item) { |
|
175 | 175 | return [$item]; |
176 | 176 | }, $list); |
177 | 177 | } |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function transactional($func) |
227 | 227 | { |
228 | - if (!is_callable($func)) { |
|
229 | - throw new \InvalidArgumentException('Expected argument of type "callable", got "' . gettype($func) . '"'); |
|
228 | + if ( ! is_callable($func)) { |
|
229 | + throw new \InvalidArgumentException('Expected argument of type "callable", got "'.gettype($func).'"'); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | $this->conn->beginTransaction(); |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | */ |
763 | 763 | public function isOpen() |
764 | 764 | { |
765 | - return (!$this->closed); |
|
765 | + return ( ! $this->closed); |
|
766 | 766 | } |
767 | 767 | |
768 | 768 | /** |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | sprintf( |
874 | 874 | 'Invalid $connection argument of type %s given%s.', |
875 | 875 | is_object($connection) ? get_class($connection) : gettype($connection), |
876 | - is_object($connection) ? '' : ': "' . $connection . '"' |
|
876 | + is_object($connection) ? '' : ': "'.$connection.'"' |
|
877 | 877 | ) |
878 | 878 | ); |
879 | 879 | } |
@@ -923,13 +923,13 @@ discard block |
||
923 | 923 | { |
924 | 924 | switch ($lockMode) { |
925 | 925 | case LockMode::OPTIMISTIC: |
926 | - if (!$class->isVersioned) { |
|
926 | + if ( ! $class->isVersioned) { |
|
927 | 927 | throw OptimisticLockException::notVersioned($class->name); |
928 | 928 | } |
929 | 929 | break; |
930 | 930 | case LockMode::PESSIMISTIC_READ: |
931 | 931 | case LockMode::PESSIMISTIC_WRITE: |
932 | - if (!$this->getConnection()->isTransactionActive()) { |
|
932 | + if ( ! $this->getConnection()->isTransactionActive()) { |
|
933 | 933 | throw TransactionRequiredException::transactionRequired(); |
934 | 934 | } |
935 | 935 | } |