@@ -5,15 +5,11 @@ |
||
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Cache; |
| 7 | 7 | |
| 8 | -use Doctrine\Common\Collections\ArrayCollection; |
|
| 9 | 8 | use Doctrine\ORM\Cache\Persister\CachedPersister; |
| 10 | 9 | use Doctrine\ORM\EntityManagerInterface; |
| 11 | 10 | use Doctrine\ORM\Mapping\AssociationMetadata; |
| 12 | 11 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 13 | 12 | use Doctrine\ORM\Query\ResultSetMapping; |
| 14 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 15 | -use Doctrine\ORM\PersistentCollection; |
|
| 16 | -use Doctrine\Common\Proxy\Proxy; |
|
| 17 | 13 | use Doctrine\ORM\Cache; |
| 18 | 14 | use Doctrine\ORM\Query; |
| 19 | 15 | use ProxyManager\Proxy\GhostObjectInterface; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Cache; |
| 7 | 7 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | $cm = $this->em->getClassMetadata($entityName); |
| 103 | 103 | |
| 104 | - $generateKeys = function (array $entry) use ($cm): EntityCacheKey { |
|
| 104 | + $generateKeys = function(array $entry) use ($cm): EntityCacheKey { |
|
| 105 | 105 | return new EntityCacheKey($cm->getRootClassName(), $entry['identifier']); |
| 106 | 106 | }; |
| 107 | 107 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | continue; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - $generateKeys = function ($id) use ($assocMetadata): EntityCacheKey { |
|
| 175 | + $generateKeys = function($id) use ($assocMetadata): EntityCacheKey { |
|
| 176 | 176 | return new EntityCacheKey($assocMetadata->getRootClassName(), $id); |
| 177 | 177 | }; |
| 178 | 178 | |
@@ -336,9 +336,9 @@ discard block |
||
| 336 | 336 | $assocIdentifier = $this->uow->getEntityIdentifier($assocValue); |
| 337 | 337 | $entityKey = new EntityCacheKey($assocMetadata->getRootClassName(), $assocIdentifier); |
| 338 | 338 | |
| 339 | - if ((! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
| 339 | + if (( ! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
| 340 | 340 | // Entity put fail |
| 341 | - if (! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
| 341 | + if ( ! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
| 342 | 342 | return null; |
| 343 | 343 | } |
| 344 | 344 | } |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Internal\Hydration; |
| 6 | 6 | |
| 7 | -use Doctrine\ORM\Event\PostLoadEventDispatcher; |
|
| 8 | 7 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 9 | 8 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
| 10 | 9 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Internal\Hydration; |
| 6 | 6 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | protected function prepare() |
| 69 | 69 | { |
| 70 | - if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
| 70 | + if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
| 71 | 71 | $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // Remember which associations are "fetch joined", so that we know where to inject |
| 79 | 79 | // collection stubs or proxies and where not. |
| 80 | - if (! isset($this->rsm->relationMap[$dqlAlias])) { |
|
| 80 | + if ( ! isset($this->rsm->relationMap[$dqlAlias])) { |
|
| 81 | 81 | continue; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 85 | 85 | |
| 86 | - if (! isset($this->rsm->aliasMap[$parent])) { |
|
| 86 | + if ( ! isset($this->rsm->aliasMap[$parent])) { |
|
| 87 | 87 | throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $class = $this->getClassMetadata($className); |
| 110 | 110 | $inverseAssoc = $class->getProperty($association->getInversedBy()); |
| 111 | 111 | |
| 112 | - if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
| 112 | + if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
| 113 | 113 | continue; |
| 114 | 114 | } |
| 115 | 115 | |
@@ -175,14 +175,14 @@ discard block |
||
| 175 | 175 | $value = $association->getValue($entity); |
| 176 | 176 | $oid = spl_object_hash($entity); |
| 177 | 177 | |
| 178 | - if (! $value instanceof PersistentCollection) { |
|
| 178 | + if ( ! $value instanceof PersistentCollection) { |
|
| 179 | 179 | $value = $association->wrap($entity, $value, $this->em); |
| 180 | 180 | |
| 181 | 181 | $association->setValue($entity, $value); |
| 182 | 182 | |
| 183 | 183 | $this->uow->setOriginalEntityProperty($oid, $fieldName, $value); |
| 184 | 184 | |
| 185 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 185 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 186 | 186 | } else if ( |
| 187 | 187 | isset($this->hints[Query::HINT_REFRESH]) || |
| 188 | 188 | (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized()) |
@@ -192,10 +192,10 @@ discard block |
||
| 192 | 192 | $value->setInitialized(true); |
| 193 | 193 | $value->unwrap()->clear(); |
| 194 | 194 | |
| 195 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 195 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 196 | 196 | } else { |
| 197 | 197 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
| 198 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
| 198 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | return $value; |
@@ -313,10 +313,10 @@ discard block |
||
| 313 | 313 | $parentAlias = $this->rsm->parentAliasMap[$dqlAlias]; |
| 314 | 314 | // we need the $path to save into the identifier map which entities were already |
| 315 | 315 | // seen for this parent-child relationship |
| 316 | - $path = $parentAlias . '.' . $dqlAlias; |
|
| 316 | + $path = $parentAlias.'.'.$dqlAlias; |
|
| 317 | 317 | |
| 318 | 318 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
| 319 | - if (! isset($nonemptyComponents[$parentAlias])) { |
|
| 319 | + if ( ! isset($nonemptyComponents[$parentAlias])) { |
|
| 320 | 320 | // TODO: Add special case code where we hydrate the right join objects into identity map at least |
| 321 | 321 | continue; |
| 322 | 322 | } |
@@ -347,15 +347,15 @@ discard block |
||
| 347 | 347 | $oid = spl_object_hash($parentObject); |
| 348 | 348 | |
| 349 | 349 | // Check the type of the relation (many or single-valued) |
| 350 | - if (! ($association instanceof ToOneAssociationMetadata)) { |
|
| 350 | + if ( ! ($association instanceof ToOneAssociationMetadata)) { |
|
| 351 | 351 | // PATH A: Collection-valued association |
| 352 | 352 | $reflFieldValue = $association->getValue($parentObject); |
| 353 | 353 | |
| 354 | 354 | if (isset($nonemptyComponents[$dqlAlias])) { |
| 355 | - $collKey = $oid . $relationField; |
|
| 355 | + $collKey = $oid.$relationField; |
|
| 356 | 356 | if (isset($this->initializedCollections[$collKey])) { |
| 357 | 357 | $reflFieldValue = $this->initializedCollections[$collKey]; |
| 358 | - } else if (! isset($this->existingCollections[$collKey])) { |
|
| 358 | + } else if ( ! isset($this->existingCollections[$collKey])) { |
|
| 359 | 359 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
| 360 | 360 | } |
| 361 | 361 | |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | $index = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false; |
| 364 | 364 | $indexIsValid = $index !== false ? isset($reflFieldValue[$index]) : false; |
| 365 | 365 | |
| 366 | - if (! $indexExists || ! $indexIsValid) { |
|
| 366 | + if ( ! $indexExists || ! $indexIsValid) { |
|
| 367 | 367 | if (isset($this->existingCollections[$collKey])) { |
| 368 | 368 | // Collection exists, only look for the element in the identity map. |
| 369 | 369 | if ($element = $this->getEntityFromIdentityMap($entityName, $data)) { |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | // PATH B: Single-valued association |
| 400 | 400 | $reflFieldValue = $association->getValue($parentObject); |
| 401 | 401 | |
| 402 | - if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
| 402 | + if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
| 403 | 403 | ($reflFieldValue instanceof GhostObjectInterface && ! $reflFieldValue->isProxyInitialized())) { |
| 404 | 404 | // we only need to take action if this value is null, |
| 405 | 405 | // we refresh the entity or its an uninitialized proxy. |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 461 | 461 | |
| 462 | 462 | // if this row has a NULL value for the root result id then make it a null result. |
| 463 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 463 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 464 | 464 | if ($this->rsm->isMixed) { |
| 465 | 465 | $result[] = [$entityKey => null]; |
| 466 | 466 | } else { |
@@ -516,13 +516,13 @@ discard block |
||
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | - if ( ! isset($resultKey) ) { |
|
| 519 | + if ( ! isset($resultKey)) { |
|
| 520 | 520 | $this->resultCounter++; |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | // Append scalar values to mixed result sets |
| 524 | 524 | if (isset($rowData['scalars'])) { |
| 525 | - if ( ! isset($resultKey) ) { |
|
| 525 | + if ( ! isset($resultKey)) { |
|
| 526 | 526 | $resultKey = (isset($this->rsm->indexByMap['scalars'])) |
| 527 | 527 | ? $row[$this->rsm->indexByMap['scalars']] |
| 528 | 528 | : $this->resultCounter - 1; |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | |
| 536 | 536 | // Append new object to mixed result sets |
| 537 | 537 | if (isset($rowData['newObjects'])) { |
| 538 | - if ( ! isset($resultKey) ) { |
|
| 538 | + if ( ! isset($resultKey)) { |
|
| 539 | 539 | $resultKey = $this->resultCounter - 1; |
| 540 | 540 | } |
| 541 | 541 | |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | $args = $newObject['args']; |
| 548 | 548 | $obj = $class->newInstanceArgs($args); |
| 549 | 549 | |
| 550 | - if ($hasNoScalars && \count($rowData['newObjects']) === 1 ) { |
|
| 550 | + if ($hasNoScalars && \count($rowData['newObjects']) === 1) { |
|
| 551 | 551 | $result[$resultKey] = $obj; |
| 552 | 552 | |
| 553 | 553 | continue; |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | |
| 7 | 7 | use Doctrine\Common\Persistence\Mapping\MappingException; |
| 8 | 8 | use Doctrine\ORM\Mapping\AssociationMetadata; |
| 9 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 10 | 9 | use Doctrine\ORM\Mapping\FieldMetadata; |
| 11 | 10 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 12 | 11 | use Doctrine\ORM\Query; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Query; |
| 6 | 6 | |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | $tokenStr = substr($dql, (int) $token['position'], $length); |
| 472 | 472 | |
| 473 | 473 | // Building informative message |
| 474 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
| 474 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
| 475 | 475 | |
| 476 | 476 | throw QueryException::semanticalError( |
| 477 | 477 | $message, |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | // If the namespace is not given then assumes the first FROM entity namespace |
| 622 | 622 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
| 623 | 623 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
| 624 | - $fqcn = $namespace . '\\' . $className; |
|
| 624 | + $fqcn = $namespace.'\\'.$className; |
|
| 625 | 625 | |
| 626 | 626 | if (class_exists($fqcn)) { |
| 627 | 627 | $expression->className = $fqcn; |
@@ -670,13 +670,13 @@ discard block |
||
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | $this->semanticalError( |
| 673 | - "There is no mapped field named '$field' on class " . $class->getClassName() . ".", $deferredItem['token'] |
|
| 673 | + "There is no mapped field named '$field' on class ".$class->getClassName().".", $deferredItem['token'] |
|
| 674 | 674 | ); |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { |
| 678 | 678 | $this->semanticalError( |
| 679 | - "The partial field selection of class " . $class->getClassName() . " must contain the identifier.", |
|
| 679 | + "The partial field selection of class ".$class->getClassName()." must contain the identifier.", |
|
| 680 | 680 | $deferredItem['token'] |
| 681 | 681 | ); |
| 682 | 682 | } |
@@ -745,9 +745,9 @@ discard block |
||
| 745 | 745 | $property = $class->getProperty($field); |
| 746 | 746 | |
| 747 | 747 | // Check if field or association exists |
| 748 | - if (! $property) { |
|
| 748 | + if ( ! $property) { |
|
| 749 | 749 | $this->semanticalError( |
| 750 | - 'Class ' . $class->getClassName() . ' has no field or association named ' . $field, |
|
| 750 | + 'Class '.$class->getClassName().' has no field or association named '.$field, |
|
| 751 | 751 | $deferredItem['token'] |
| 752 | 752 | ); |
| 753 | 753 | } |
@@ -786,8 +786,8 @@ discard block |
||
| 786 | 786 | // Build the error message |
| 787 | 787 | $semanticalError = 'Invalid PathExpression. '; |
| 788 | 788 | $semanticalError .= \count($expectedStringTypes) === 1 |
| 789 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
| 790 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
| 789 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
| 790 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
| 791 | 791 | |
| 792 | 792 | $this->semanticalError($semanticalError, $deferredItem['token']); |
| 793 | 793 | } |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | |
| 957 | 957 | list($namespaceAlias, $simpleClassName) = explode(':', $this->lexer->token['value']); |
| 958 | 958 | |
| 959 | - $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 959 | + $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 960 | 960 | } |
| 961 | 961 | |
| 962 | 962 | return $schemaName; |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | |
| 1042 | 1042 | if ( ! isset($this->queryComponents[$identVariable])) { |
| 1043 | 1043 | $this->semanticalError( |
| 1044 | - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' |
|
| 1044 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
| 1045 | 1045 | ); |
| 1046 | 1046 | } |
| 1047 | 1047 | |
@@ -1054,8 +1054,8 @@ discard block |
||
| 1054 | 1054 | $qComp = $this->queryComponents[$identVariable]; |
| 1055 | 1055 | $class = $qComp['metadata']; |
| 1056 | 1056 | |
| 1057 | - if (! (($property = $class->getProperty($field)) !== null && $property instanceof AssociationMetadata)) { |
|
| 1058 | - $this->semanticalError('Class ' . $class->getClassName() . ' has no association named ' . $field); |
|
| 1057 | + if ( ! (($property = $class->getProperty($field)) !== null && $property instanceof AssociationMetadata)) { |
|
| 1058 | + $this->semanticalError('Class '.$class->getClassName().' has no association named '.$field); |
|
| 1059 | 1059 | } |
| 1060 | 1060 | |
| 1061 | 1061 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -2477,7 +2477,7 @@ discard block |
||
| 2477 | 2477 | // Peek beyond the matching closing parenthesis ')' |
| 2478 | 2478 | $peek = $this->peekBeyondClosingParenthesis(); |
| 2479 | 2479 | |
| 2480 | - if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) || |
|
| 2480 | + if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) || |
|
| 2481 | 2481 | in_array($peek['type'], [Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS]) || |
| 2482 | 2482 | $this->isMathOperator($peek)) { |
| 2483 | 2483 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
@@ -2582,7 +2582,7 @@ discard block |
||
| 2582 | 2582 | return $this->NullComparisonExpression(); |
| 2583 | 2583 | } |
| 2584 | 2584 | |
| 2585 | - if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
| 2585 | + if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
| 2586 | 2586 | return $this->EmptyCollectionComparisonExpression(); |
| 2587 | 2587 | } |
| 2588 | 2588 | |
@@ -4,11 +4,9 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools; |
| 6 | 6 | |
| 7 | -use Doctrine\Common\Persistence\Proxy; |
|
| 8 | 7 | use Doctrine\ORM\EntityManagerInterface; |
| 9 | 8 | use Doctrine\ORM\Event\OnFlushEventArgs; |
| 10 | 9 | use Doctrine\ORM\Mapping\AssociationMetadata; |
| 11 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 12 | 10 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 13 | 11 | use Doctrine\ORM\PersistentCollection; |
| 14 | 12 | use Doctrine\ORM\UnitOfWork; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools; |
| 6 | 6 | |
@@ -77,20 +77,20 @@ discard block |
||
| 77 | 77 | fwrite($fh, "Flush Operation [".$this->context."] - Dumping identity map:\n"); |
| 78 | 78 | |
| 79 | 79 | foreach ($identityMap as $className => $map) { |
| 80 | - fwrite($fh, "Class: ". $className . "\n"); |
|
| 80 | + fwrite($fh, "Class: ".$className."\n"); |
|
| 81 | 81 | |
| 82 | 82 | foreach ($map as $entity) { |
| 83 | - fwrite($fh, " Entity: " . $this->getIdString($entity, $uow) . " " . spl_object_hash($entity)."\n"); |
|
| 83 | + fwrite($fh, " Entity: ".$this->getIdString($entity, $uow)." ".spl_object_hash($entity)."\n"); |
|
| 84 | 84 | fwrite($fh, " Associations:\n"); |
| 85 | 85 | |
| 86 | 86 | $cm = $em->getClassMetadata($className); |
| 87 | 87 | |
| 88 | 88 | foreach ($cm->getDeclaredPropertiesIterator() as $field => $association) { |
| 89 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 89 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 90 | 90 | continue; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - fwrite($fh, " " . $field . " "); |
|
| 93 | + fwrite($fh, " ".$field." "); |
|
| 94 | 94 | |
| 95 | 95 | $value = $association->getValue($entity); |
| 96 | 96 | |
@@ -101,25 +101,25 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | if ($association instanceof ToOneAssociationMetadata) { |
| 104 | - if ($value instanceof GhostObjectInterface && !$value->isProxyInitialized()) { |
|
| 104 | + if ($value instanceof GhostObjectInterface && ! $value->isProxyInitialized()) { |
|
| 105 | 105 | fwrite($fh, "[PROXY] "); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - fwrite($fh, $this->getIdString($value, $uow) . " " . spl_object_hash($value) . "\n"); |
|
| 108 | + fwrite($fh, $this->getIdString($value, $uow)." ".spl_object_hash($value)."\n"); |
|
| 109 | 109 | } else { |
| 110 | - $initialized = !($value instanceof PersistentCollection) || $value->isInitialized(); |
|
| 110 | + $initialized = ! ($value instanceof PersistentCollection) || $value->isInitialized(); |
|
| 111 | 111 | |
| 112 | 112 | if ($initialized) { |
| 113 | - fwrite($fh, "[INITIALIZED] " . $this->getType($value). " " . count($value) . " elements\n"); |
|
| 113 | + fwrite($fh, "[INITIALIZED] ".$this->getType($value)." ".count($value)." elements\n"); |
|
| 114 | 114 | |
| 115 | 115 | foreach ($value as $obj) { |
| 116 | - fwrite($fh, " " . $this->getIdString($obj, $uow) . " " . spl_object_hash($obj)."\n"); |
|
| 116 | + fwrite($fh, " ".$this->getIdString($obj, $uow)." ".spl_object_hash($obj)."\n"); |
|
| 117 | 117 | } |
| 118 | 118 | } else { |
| 119 | - fwrite($fh, "[PROXY] " . $this->getType($value) . " unknown element size\n"); |
|
| 119 | + fwrite($fh, "[PROXY] ".$this->getType($value)." unknown element size\n"); |
|
| 120 | 120 | |
| 121 | 121 | foreach ($value->unwrap() as $obj) { |
| 122 | - fwrite($fh, " " . $this->getIdString($obj, $uow) . " " . spl_object_hash($obj)."\n"); |
|
| 122 | + fwrite($fh, " ".$this->getIdString($obj, $uow)." ".spl_object_hash($obj)."\n"); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -1173,7 +1173,7 @@ discard block |
||
| 1173 | 1173 | /** |
| 1174 | 1174 | * Schedules an entity for being updated. |
| 1175 | 1175 | * |
| 1176 | - * @param object $entity The entity to schedule for being updated. |
|
| 1176 | + * @param \Doctrine\Tests\Models\Forum\ForumUser $entity The entity to schedule for being updated. |
|
| 1177 | 1177 | * |
| 1178 | 1178 | * @return void |
| 1179 | 1179 | * |
@@ -1241,7 +1241,7 @@ discard block |
||
| 1241 | 1241 | /** |
| 1242 | 1242 | * Checks whether an entity is registered to be checked in the unit of work. |
| 1243 | 1243 | * |
| 1244 | - * @param object $entity |
|
| 1244 | + * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity |
|
| 1245 | 1245 | * |
| 1246 | 1246 | * @return boolean |
| 1247 | 1247 | */ |
@@ -2822,9 +2822,9 @@ discard block |
||
| 2822 | 2822 | /** |
| 2823 | 2823 | * Notifies this UnitOfWork of a property change in an entity. |
| 2824 | 2824 | * |
| 2825 | - * @param object $entity The entity that owns the property. |
|
| 2825 | + * @param \Doctrine\Tests\Models\CustomType\CustomTypeParent $entity The entity that owns the property. |
|
| 2826 | 2826 | * @param string $propertyName The name of the property that changed. |
| 2827 | - * @param mixed $oldValue The old value of the property. |
|
| 2827 | + * @param integer|null $oldValue The old value of the property. |
|
| 2828 | 2828 | * @param mixed $newValue The new value of the property. |
| 2829 | 2829 | * |
| 2830 | 2830 | * @return void |
@@ -3023,7 +3023,7 @@ discard block |
||
| 3023 | 3023 | /** |
| 3024 | 3024 | * Verifies if two given entities actually are the same based on identifier comparison |
| 3025 | 3025 | * |
| 3026 | - * @param object $entity1 |
|
| 3026 | + * @param GhostObjectInterface $entity1 |
|
| 3027 | 3027 | * @param object $entity2 |
| 3028 | 3028 | * |
| 3029 | 3029 | * @return bool |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM; |
| 6 | 6 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | // Entity deletions come last and need to be in reverse commit order |
| 369 | 369 | if ($this->entityDeletions) { |
| 370 | 370 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
| 371 | - if (! $this->entityDeletions) { |
|
| 371 | + if ( ! $this->entityDeletions) { |
|
| 372 | 372 | break; // just a performance optimisation |
| 373 | 373 | } |
| 374 | 374 | |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $oid = spl_object_hash($entity); |
| 454 | 454 | $data = []; |
| 455 | 455 | |
| 456 | - if (!isset($this->entityChangeSets[$oid])) { |
|
| 456 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 457 | 457 | return $data; |
| 458 | 458 | } |
| 459 | 459 | |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | || ! $class->getProperty($name) instanceof FieldMetadata |
| 537 | 537 | || ! $class->getProperty($name)->hasValueGenerator() |
| 538 | 538 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
| 539 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 539 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 540 | 540 | $actualData[$name] = $value; |
| 541 | 541 | } |
| 542 | 542 | } |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | if ($owner === null) { // cloned |
| 591 | 591 | $actualValue->setOwner($entity, $property); |
| 592 | 592 | } else if ($owner !== $entity) { // no clone, we have to fix |
| 593 | - if (! $actualValue->isInitialized()) { |
|
| 593 | + if ( ! $actualValue->isInitialized()) { |
|
| 594 | 594 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 595 | 595 | } |
| 596 | 596 | |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | // A PersistentCollection was de-referenced, so delete it. |
| 631 | 631 | $coid = spl_object_hash($orgValue); |
| 632 | 632 | |
| 633 | - if (!isset($this->collectionDeletions[$coid])) { |
|
| 633 | + if ( ! isset($this->collectionDeletions[$coid])) { |
|
| 634 | 634 | $this->collectionDeletions[$coid] = $orgValue; |
| 635 | 635 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
| 636 | 636 | } |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | |
| 653 | 653 | // Look for changes in associations of the entity |
| 654 | 654 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 655 | - if (! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) { |
|
| 655 | + if ( ! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) { |
|
| 656 | 656 | continue; |
| 657 | 657 | } |
| 658 | 658 | |
@@ -756,13 +756,13 @@ discard block |
||
| 756 | 756 | $targetClass = $this->em->getClassMetadata($targetEntity); |
| 757 | 757 | |
| 758 | 758 | foreach ($unwrappedValue as $key => $entry) { |
| 759 | - if (! ($entry instanceof $targetEntity)) { |
|
| 759 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 760 | 760 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | $state = $this->getEntityState($entry, self::STATE_NEW); |
| 764 | 764 | |
| 765 | - if (! ($entry instanceof $targetEntity)) { |
|
| 765 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 766 | 766 | throw ORMException::unexpectedAssociationValue( |
| 767 | 767 | $association->getSourceEntity(), |
| 768 | 768 | $association->getName(), |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | $persister = $this->getEntityPersister($class->getClassName()); |
| 822 | 822 | $generationPlan->executeImmediate($this->em, $entity); |
| 823 | 823 | |
| 824 | - if (! $generationPlan->containsDeferred()) { |
|
| 824 | + if ( ! $generationPlan->containsDeferred()) { |
|
| 825 | 825 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
| 826 | 826 | $this->entityIdentifiers[$oid] = $id; |
| 827 | 827 | } |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | { |
| 855 | 855 | $oid = spl_object_hash($entity); |
| 856 | 856 | |
| 857 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 857 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 858 | 858 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
| 859 | 859 | } |
| 860 | 860 | |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | break; |
| 877 | 877 | |
| 878 | 878 | case ($property instanceof FieldMetadata): |
| 879 | - if (! $property->isPrimaryKey() |
|
| 879 | + if ( ! $property->isPrimaryKey() |
|
| 880 | 880 | || ! $property->getValueGenerator() |
| 881 | 881 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
| 882 | 882 | $actualData[$name] = $property->getValue($entity); |
@@ -1029,7 +1029,7 @@ discard block |
||
| 1029 | 1029 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1030 | 1030 | // is obtained by a new entity because the old one went out of scope. |
| 1031 | 1031 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1032 | - if (! $class->isIdentifierComposite()) { |
|
| 1032 | + if ( ! $class->isIdentifierComposite()) { |
|
| 1033 | 1033 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
| 1034 | 1034 | |
| 1035 | 1035 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | // Calculate dependencies for new nodes |
| 1077 | 1077 | while ($class = array_pop($newNodes)) { |
| 1078 | 1078 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 1079 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1079 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1080 | 1080 | continue; |
| 1081 | 1081 | } |
| 1082 | 1082 | |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | |
| 1091 | 1091 | $weight = ! array_filter( |
| 1092 | 1092 | $property->getJoinColumns(), |
| 1093 | - function (JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
| 1093 | + function(JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
| 1094 | 1094 | ); |
| 1095 | 1095 | |
| 1096 | 1096 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
@@ -1384,7 +1384,7 @@ discard block |
||
| 1384 | 1384 | $persister = $this->getEntityPersister($class->getClassName()); |
| 1385 | 1385 | $id = $persister->getIdentifier($entity); |
| 1386 | 1386 | |
| 1387 | - if (! $id) { |
|
| 1387 | + if ( ! $id) { |
|
| 1388 | 1388 | return self::STATE_NEW; |
| 1389 | 1389 | } |
| 1390 | 1390 | |
@@ -1619,7 +1619,7 @@ discard block |
||
| 1619 | 1619 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
| 1620 | 1620 | |
| 1621 | 1621 | default: |
| 1622 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1622 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | 1625 | $this->cascadePersist($entity, $visited); |
@@ -1689,7 +1689,7 @@ discard block |
||
| 1689 | 1689 | case self::STATE_DETACHED: |
| 1690 | 1690 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
| 1691 | 1691 | default: |
| 1692 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1692 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1693 | 1693 | } |
| 1694 | 1694 | |
| 1695 | 1695 | } |
@@ -1758,7 +1758,7 @@ discard block |
||
| 1758 | 1758 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1759 | 1759 | |
| 1760 | 1760 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1761 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
| 1761 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
| 1762 | 1762 | continue; |
| 1763 | 1763 | } |
| 1764 | 1764 | |
@@ -1805,7 +1805,7 @@ discard block |
||
| 1805 | 1805 | } |
| 1806 | 1806 | |
| 1807 | 1807 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1808 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
| 1808 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
| 1809 | 1809 | continue; |
| 1810 | 1810 | } |
| 1811 | 1811 | |
@@ -1821,7 +1821,7 @@ discard block |
||
| 1821 | 1821 | |
| 1822 | 1822 | case ($relatedEntities instanceof Collection): |
| 1823 | 1823 | case (is_array($relatedEntities)): |
| 1824 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1824 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1825 | 1825 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1826 | 1826 | $this->em->getClassMetadata($targetEntity), |
| 1827 | 1827 | $association, |
@@ -1836,7 +1836,7 @@ discard block |
||
| 1836 | 1836 | break; |
| 1837 | 1837 | |
| 1838 | 1838 | case ($relatedEntities !== null): |
| 1839 | - if (! $relatedEntities instanceof $targetEntity) { |
|
| 1839 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
| 1840 | 1840 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1841 | 1841 | $this->em->getClassMetadata($targetEntity), |
| 1842 | 1842 | $association, |
@@ -1867,7 +1867,7 @@ discard block |
||
| 1867 | 1867 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1868 | 1868 | |
| 1869 | 1869 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1870 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
| 1870 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
| 1871 | 1871 | continue; |
| 1872 | 1872 | } |
| 1873 | 1873 | |
@@ -1950,7 +1950,7 @@ discard block |
||
| 1950 | 1950 | case LockMode::NONE === $lockMode: |
| 1951 | 1951 | case LockMode::PESSIMISTIC_READ === $lockMode: |
| 1952 | 1952 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
| 1953 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
| 1953 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 1954 | 1954 | throw TransactionRequiredException::transactionRequired(); |
| 1955 | 1955 | } |
| 1956 | 1956 | |
@@ -2196,7 +2196,7 @@ discard block |
||
| 2196 | 2196 | } |
| 2197 | 2197 | |
| 2198 | 2198 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
| 2199 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 2199 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 2200 | 2200 | continue; |
| 2201 | 2201 | } |
| 2202 | 2202 | |
@@ -2245,7 +2245,7 @@ discard block |
||
| 2245 | 2245 | continue; |
| 2246 | 2246 | } |
| 2247 | 2247 | |
| 2248 | - if (! $association->isOwningSide()) { |
|
| 2248 | + if ( ! $association->isOwningSide()) { |
|
| 2249 | 2249 | // use the given entity association |
| 2250 | 2250 | if (isset($data[$field]) && is_object($data[$field]) && |
| 2251 | 2251 | isset($this->entityStates[spl_object_hash($data[$field])])) { |
@@ -2295,7 +2295,7 @@ discard block |
||
| 2295 | 2295 | $associatedId[$targetField] = $joinColumnValue; |
| 2296 | 2296 | } |
| 2297 | 2297 | |
| 2298 | - if (! $associatedId) { |
|
| 2298 | + if ( ! $associatedId) { |
|
| 2299 | 2299 | // Foreign key is NULL |
| 2300 | 2300 | $association->setValue($entity, null); |
| 2301 | 2301 | $this->originalEntityData[$oid][$field] = null; |
@@ -2304,7 +2304,7 @@ discard block |
||
| 2304 | 2304 | } |
| 2305 | 2305 | |
| 2306 | 2306 | // @todo guilhermeblanco Can we remove the need of this somehow? |
| 2307 | - if (!isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2307 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2308 | 2308 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
| 2309 | 2309 | } |
| 2310 | 2310 | |
@@ -2321,7 +2321,7 @@ discard block |
||
| 2321 | 2321 | // If this is an uninitialized proxy, we are deferring eager loads, |
| 2322 | 2322 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
| 2323 | 2323 | // then we can append this entity for eager loading! |
| 2324 | - if (!$targetClass->isIdentifierComposite() && |
|
| 2324 | + if ( ! $targetClass->isIdentifierComposite() && |
|
| 2325 | 2325 | $newValue instanceof GhostObjectInterface && |
| 2326 | 2326 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2327 | 2327 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2373,7 +2373,7 @@ discard block |
||
| 2373 | 2373 | break; |
| 2374 | 2374 | |
| 2375 | 2375 | // Deferred eager load only works for single identifier classes |
| 2376 | - case (isset($hints[self::HINT_DEFEREAGERLOAD]) && !$targetClass->isIdentifierComposite()): |
|
| 2376 | + case (isset($hints[self::HINT_DEFEREAGERLOAD]) && ! $targetClass->isIdentifierComposite()): |
|
| 2377 | 2377 | // TODO: Is there a faster approach? |
| 2378 | 2378 | $this->eagerLoadingEntities[$targetClass->getRootClassName()][$relatedIdHash] = current($normalizedAssociatedId); |
| 2379 | 2379 | |
@@ -2626,7 +2626,7 @@ discard block |
||
| 2626 | 2626 | $normalizedAssociatedId = []; |
| 2627 | 2627 | |
| 2628 | 2628 | foreach ($targetClass->getDeclaredPropertiesIterator() as $name => $declaredProperty) { |
| 2629 | - if (! \array_key_exists($name, $flatIdentifier)) { |
|
| 2629 | + if ( ! \array_key_exists($name, $flatIdentifier)) { |
|
| 2630 | 2630 | continue; |
| 2631 | 2631 | } |
| 2632 | 2632 | |
@@ -2833,7 +2833,7 @@ discard block |
||
| 2833 | 2833 | { |
| 2834 | 2834 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 2835 | 2835 | |
| 2836 | - if (! $class->getProperty($propertyName)) { |
|
| 2836 | + if ( ! $class->getProperty($propertyName)) { |
|
| 2837 | 2837 | return; // ignore non-persistent fields |
| 2838 | 2838 | } |
| 2839 | 2839 | |
@@ -2973,7 +2973,7 @@ discard block |
||
| 2973 | 2973 | */ |
| 2974 | 2974 | private function afterTransactionComplete() |
| 2975 | 2975 | { |
| 2976 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2976 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2977 | 2977 | $persister->afterTransactionComplete(); |
| 2978 | 2978 | }); |
| 2979 | 2979 | } |
@@ -2983,7 +2983,7 @@ discard block |
||
| 2983 | 2983 | */ |
| 2984 | 2984 | private function afterTransactionRolledBack() |
| 2985 | 2985 | { |
| 2986 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2986 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2987 | 2987 | $persister->afterTransactionRolledBack(); |
| 2988 | 2988 | }); |
| 2989 | 2989 | } |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
| 7 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
| 8 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
| 9 | 8 | use Doctrine\Tests\Models\ECommerce\ECommerceCart; |
| 10 | 9 | use Doctrine\Tests\Models\ECommerce\ECommerceCustomer; |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | use Doctrine\Tests\Models\CMS\CmsTag; |
| 13 | 13 | use Doctrine\Tests\Models\CMS\CmsUser; |
| 14 | 14 | use Doctrine\Tests\OrmFunctionalTestCase; |
| 15 | -use Doctrine\Tests\Proxies\__CG__\Doctrine\Tests\Models\CMS\CmsUser as CmsUserProxy; |
|
| 16 | 15 | use ProxyManager\Configuration; |
| 17 | 16 | use ProxyManager\Proxy\GhostObjectInterface; |
| 18 | 17 | |
@@ -86,6 +86,9 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | + /** |
|
| 90 | + * @param string $propName |
|
| 91 | + */ |
|
| 89 | 92 | protected function onPropertyChanged($propName, $oldValue, $newValue) { |
| 90 | 93 | foreach ($this->listeners as $listener) { |
| 91 | 94 | $listener->propertyChanged($this, $propName, $oldValue, $newValue); |
@@ -112,11 +115,17 @@ discard block |
||
| 112 | 115 | return $this->name; |
| 113 | 116 | } |
| 114 | 117 | |
| 118 | + /** |
|
| 119 | + * @param string $name |
|
| 120 | + */ |
|
| 115 | 121 | function setName($name) { |
| 116 | 122 | $this->onPropertyChanged('name', $this->name, $name); |
| 117 | 123 | $this->name = $name; |
| 118 | 124 | } |
| 119 | 125 | |
| 126 | + /** |
|
| 127 | + * @param DDC1690Child $child |
|
| 128 | + */ |
|
| 120 | 129 | function setChild($child) { |
| 121 | 130 | $this->child = $child; |
| 122 | 131 | } |
@@ -145,11 +154,17 @@ discard block |
||
| 145 | 154 | return $this->name; |
| 146 | 155 | } |
| 147 | 156 | |
| 157 | + /** |
|
| 158 | + * @param string $name |
|
| 159 | + */ |
|
| 148 | 160 | function setName($name) { |
| 149 | 161 | $this->onPropertyChanged('name', $this->name, $name); |
| 150 | 162 | $this->name = $name; |
| 151 | 163 | } |
| 152 | 164 | |
| 165 | + /** |
|
| 166 | + * @param DDC1690Parent $parent |
|
| 167 | + */ |
|
| 153 | 168 | function setParent($parent) { |
| 154 | 169 | $this->parent = $parent; |
| 155 | 170 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional\Ticket; |
| 6 | 6 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public $listeners = []; |
| 82 | 82 | |
| 83 | 83 | public function addPropertyChangedListener(PropertyChangedListener $listener) { |
| 84 | - if (! \in_array($listener, $this->listeners, true)) { |
|
| 84 | + if ( ! \in_array($listener, $this->listeners, true)) { |
|
| 85 | 85 | $this->listeners[] = $listener; |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $user->username = 'gblanco'; |
| 184 | 184 | $user->status = 'developer'; |
| 185 | 185 | |
| 186 | - for ($i=0; $i<3; ++$i) { |
|
| 186 | + for ($i = 0; $i < 3; ++$i) { |
|
| 187 | 187 | $phone = new CmsPhonenumber; |
| 188 | 188 | $phone->phonenumber = 100 + $i; |
| 189 | 189 | $user->addPhonenumber($phone); |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | $user->username = 'gblanco'; |
| 412 | 412 | $user->status = 'developer'; |
| 413 | 413 | |
| 414 | - for ($i=0; $i<3; ++$i) { |
|
| 414 | + for ($i = 0; $i < 3; ++$i) { |
|
| 415 | 415 | $phone = new CmsPhonenumber; |
| 416 | 416 | $phone->phonenumber = 100 + $i; |
| 417 | 417 | $user->addPhonenumber($phone); |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | $user->username = 'gblanco'; |
| 452 | 452 | $user->status = 'developer'; |
| 453 | 453 | |
| 454 | - for ($i=0; $i<3; ++$i) { |
|
| 454 | + for ($i = 0; $i < 3; ++$i) { |
|
| 455 | 455 | $phone = new CmsPhonenumber; |
| 456 | 456 | $phone->phonenumber = 100 + $i; |
| 457 | 457 | $user->addPhonenumber($phone); |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | $user->username = 'gblanco'; |
| 493 | 493 | $user->status = 'developer'; |
| 494 | 494 | |
| 495 | - for ($i=0; $i<3; ++$i) { |
|
| 495 | + for ($i = 0; $i < 3; ++$i) { |
|
| 496 | 496 | $phone = new CmsPhonenumber; |
| 497 | 497 | $phone->phonenumber = 100 + $i; |
| 498 | 498 | $user->addPhonenumber($phone); |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | |
| 876 | 876 | self::assertInstanceOf(GhostObjectInterface::class, $fetchedUser, "It IS a proxy, ..."); |
| 877 | 877 | self::assertTrue($fetchedUser->isProxyInitialized(), "...but its initialized!"); |
| 878 | - self::assertEquals($qc+2, $this->getCurrentQueryCount()); |
|
| 878 | + self::assertEquals($qc + 2, $this->getCurrentQueryCount()); |
|
| 879 | 879 | } |
| 880 | 880 | |
| 881 | 881 | /** |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | |
| 937 | 937 | $this->expectException(ORMInvalidArgumentException::class); |
| 938 | 938 | $this->expectExceptionMessage( |
| 939 | - 'Expected value of type "Doctrine\Tests\Models\CMS\CmsAddress" for association field ' . |
|
| 939 | + 'Expected value of type "Doctrine\Tests\Models\CMS\CmsAddress" for association field '. |
|
| 940 | 940 | '"Doctrine\Tests\Models\CMS\CmsUser#$address", got "Doctrine\Tests\Models\CMS\CmsUser" instead.' |
| 941 | 941 | ); |
| 942 | 942 | |