@@ -67,7 +67,7 @@ |
||
| 67 | 67 | public function resolve($className) |
| 68 | 68 | { |
| 69 | 69 | if (isset($this->instances[$className = trim($className, '\\')])) { |
| 70 | - return $this->instances[$className]; |
|
| 70 | + return $this->instances[$className]; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | return $this->instances[$className] = new $className(); |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | abstract class AbstractEntityPersister implements CachedEntityPersister |
| 43 | 43 | { |
| 44 | - /** |
|
| 45 | - * @var \Doctrine\ORM\UnitOfWork |
|
| 46 | - */ |
|
| 44 | + /** |
|
| 45 | + * @var \Doctrine\ORM\UnitOfWork |
|
| 46 | + */ |
|
| 47 | 47 | protected $uow; |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | protected $class; |
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @var array |
|
| 66 | - */ |
|
| 64 | + /** |
|
| 65 | + * @var array |
|
| 66 | + */ |
|
| 67 | 67 | protected $queuedCache = array(); |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -715,9 +715,9 @@ |
||
| 715 | 715 | ); |
| 716 | 716 | } |
| 717 | 717 | |
| 718 | - /** |
|
| 719 | - * {@inheritdoc} |
|
| 720 | - */ |
|
| 718 | + /** |
|
| 719 | + * {@inheritdoc} |
|
| 720 | + */ |
|
| 721 | 721 | protected function getHash() |
| 722 | 722 | { |
| 723 | 723 | return sha1(parent::getHash(). '-'. $this->_firstResult . '-' . $this->_maxResults); |
@@ -220,7 +220,7 @@ |
||
| 220 | 220 | $exporter->setMetadata($metadata); |
| 221 | 221 | $exporter->export(); |
| 222 | 222 | |
| 223 | - $output->writeln(PHP_EOL . sprintf( |
|
| 223 | + $output->writeln(PHP_EOL.sprintf( |
|
| 224 | 224 | 'Converting Doctrine 1.X schema to "<info>%s</info>" mapping type in "<info>%s</info>"', $toType, $destPath |
| 225 | 225 | )); |
| 226 | 226 | } else { |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @var string |
| 35 | 35 | */ |
| 36 | - protected $preSeparator = ''; |
|
| 36 | + protected $preSeparator = ''; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @var string |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | /** |
| 58 | 58 | * Constructor. |
| 59 | 59 | * |
| 60 | - * @param Query|QueryBuilder $query A Doctrine ORM query or query builder. |
|
| 60 | + * @param Query $query A Doctrine ORM query or query builder. |
|
| 61 | 61 | * @param boolean $fetchJoinCollection Whether the query joins a collection (true by default). |
| 62 | 62 | */ |
| 63 | 63 | public function __construct($query, $fetchJoinCollection = true) |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | /** |
| 1238 | 1238 | * Schedules an entity for being updated. |
| 1239 | 1239 | * |
| 1240 | - * @param object $entity The entity to schedule for being updated. |
|
| 1240 | + * @param \Doctrine\Tests\Models\Forum\ForumUser $entity The entity to schedule for being updated. |
|
| 1241 | 1241 | * |
| 1242 | 1242 | * @return void |
| 1243 | 1243 | * |
@@ -1305,7 +1305,7 @@ discard block |
||
| 1305 | 1305 | /** |
| 1306 | 1306 | * Checks whether an entity is registered to be checked in the unit of work. |
| 1307 | 1307 | * |
| 1308 | - * @param object $entity |
|
| 1308 | + * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity |
|
| 1309 | 1309 | * |
| 1310 | 1310 | * @return boolean |
| 1311 | 1311 | */ |
@@ -3121,7 +3121,7 @@ discard block |
||
| 3121 | 3121 | * |
| 3122 | 3122 | * @param object $entity The entity that owns the property. |
| 3123 | 3123 | * @param string $propertyName The name of the property that changed. |
| 3124 | - * @param mixed $oldValue The old value of the property. |
|
| 3124 | + * @param null|integer $oldValue The old value of the property. |
|
| 3125 | 3125 | * @param mixed $newValue The new value of the property. |
| 3126 | 3126 | * |
| 3127 | 3127 | * @return void |
@@ -3321,7 +3321,7 @@ discard block |
||
| 3321 | 3321 | /** |
| 3322 | 3322 | * Verifies if two given entities actually are the same based on identifier comparison |
| 3323 | 3323 | * |
| 3324 | - * @param object $entity1 |
|
| 3324 | + * @param Proxy $entity1 |
|
| 3325 | 3325 | * @param object $entity2 |
| 3326 | 3326 | * |
| 3327 | 3327 | * @return bool |
@@ -26,7 +26,6 @@ discard block |
||
| 26 | 26 | use Exception; |
| 27 | 27 | use InvalidArgumentException; |
| 28 | 28 | use UnexpectedValueException; |
| 29 | - |
|
| 30 | 29 | use Doctrine\Common\Collections\ArrayCollection; |
| 31 | 30 | use Doctrine\Common\Collections\Collection; |
| 32 | 31 | use Doctrine\Common\NotifyPropertyChanged; |
@@ -34,14 +33,12 @@ discard block |
||
| 34 | 33 | use Doctrine\Common\Persistence\ObjectManagerAware; |
| 35 | 34 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 36 | 35 | use Doctrine\ORM\Proxy\Proxy; |
| 37 | - |
|
| 38 | 36 | use Doctrine\ORM\Event\LifecycleEventArgs; |
| 39 | 37 | use Doctrine\ORM\Event\PreUpdateEventArgs; |
| 40 | 38 | use Doctrine\ORM\Event\PreFlushEventArgs; |
| 41 | 39 | use Doctrine\ORM\Event\OnFlushEventArgs; |
| 42 | 40 | use Doctrine\ORM\Event\PostFlushEventArgs; |
| 43 | 41 | use Doctrine\ORM\Event\ListenersInvoker; |
| 44 | - |
|
| 45 | 42 | use Doctrine\ORM\Cache\Persister\CachedPersister; |
| 46 | 43 | use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; |
| 47 | 44 | use Doctrine\ORM\Persisters\Entity\SingleTablePersister; |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | $state = $this->getEntityState($entity); |
| 464 | 464 | |
| 465 | 465 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
| 466 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
| 466 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | $oid = spl_object_hash($entity); |
| 520 | 520 | $data = array(); |
| 521 | 521 | |
| 522 | - if (!isset($this->entityChangeSets[$oid])) { |
|
| 522 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 523 | 523 | return $data; |
| 524 | 524 | } |
| 525 | 525 | |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | if ($owner === null) { // cloned |
| 683 | 683 | $actualValue->setOwner($entity, $assoc); |
| 684 | 684 | } else if ($owner !== $entity) { // no clone, we have to fix |
| 685 | - if (!$actualValue->isInitialized()) { |
|
| 685 | + if ( ! $actualValue->isInitialized()) { |
|
| 686 | 686 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 687 | 687 | } |
| 688 | 688 | $newValue = clone $actualValue; |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
| 829 | 829 | |
| 830 | 830 | foreach ($unwrappedValue as $key => $entry) { |
| 831 | - if (! ($entry instanceof $targetClass->name)) { |
|
| 831 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
| 832 | 832 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
| 833 | 833 | } |
| 834 | 834 | |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | |
| 1157 | 1157 | $joinColumns = reset($assoc['joinColumns']); |
| 1158 | 1158 | |
| 1159 | - $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable'])); |
|
| 1159 | + $calc->addDependency($targetClass->name, $class->name, (int) empty($joinColumns['nullable'])); |
|
| 1160 | 1160 | |
| 1161 | 1161 | // If the target class has mapped subclasses, these share the same dependency. |
| 1162 | 1162 | if ( ! $targetClass->subClasses) { |
@@ -1683,7 +1683,7 @@ discard block |
||
| 1683 | 1683 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
| 1684 | 1684 | |
| 1685 | 1685 | default: |
| 1686 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1686 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1687 | 1687 | } |
| 1688 | 1688 | |
| 1689 | 1689 | $this->cascadePersist($entity, $visited); |
@@ -1753,7 +1753,7 @@ discard block |
||
| 1753 | 1753 | case self::STATE_DETACHED: |
| 1754 | 1754 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
| 1755 | 1755 | default: |
| 1756 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1756 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1757 | 1757 | } |
| 1758 | 1758 | |
| 1759 | 1759 | } |
@@ -1904,7 +1904,7 @@ discard block |
||
| 1904 | 1904 | */ |
| 1905 | 1905 | private function isLoaded($entity) |
| 1906 | 1906 | { |
| 1907 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 1907 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 1908 | 1908 | } |
| 1909 | 1909 | |
| 1910 | 1910 | /** |
@@ -2062,7 +2062,7 @@ discard block |
||
| 2062 | 2062 | |
| 2063 | 2063 | $associationMappings = array_filter( |
| 2064 | 2064 | $class->associationMappings, |
| 2065 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2065 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2066 | 2066 | ); |
| 2067 | 2067 | |
| 2068 | 2068 | foreach ($associationMappings as $assoc) { |
@@ -2105,7 +2105,7 @@ discard block |
||
| 2105 | 2105 | |
| 2106 | 2106 | $associationMappings = array_filter( |
| 2107 | 2107 | $class->associationMappings, |
| 2108 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2108 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2109 | 2109 | ); |
| 2110 | 2110 | |
| 2111 | 2111 | foreach ($associationMappings as $assoc) { |
@@ -2149,7 +2149,7 @@ discard block |
||
| 2149 | 2149 | |
| 2150 | 2150 | $associationMappings = array_filter( |
| 2151 | 2151 | $class->associationMappings, |
| 2152 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2152 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2153 | 2153 | ); |
| 2154 | 2154 | |
| 2155 | 2155 | foreach ($associationMappings as $assoc) { |
@@ -2188,7 +2188,7 @@ discard block |
||
| 2188 | 2188 | |
| 2189 | 2189 | $associationMappings = array_filter( |
| 2190 | 2190 | $class->associationMappings, |
| 2191 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
| 2191 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
| 2192 | 2192 | ); |
| 2193 | 2193 | |
| 2194 | 2194 | foreach ($associationMappings as $assoc) { |
@@ -2217,7 +2217,7 @@ discard block |
||
| 2217 | 2217 | break; |
| 2218 | 2218 | |
| 2219 | 2219 | case ($relatedEntities !== null): |
| 2220 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2220 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2221 | 2221 | throw ORMInvalidArgumentException::invalidAssociation( |
| 2222 | 2222 | $this->em->getClassMetadata($assoc['targetEntity']), |
| 2223 | 2223 | $assoc, |
@@ -2248,13 +2248,13 @@ discard block |
||
| 2248 | 2248 | |
| 2249 | 2249 | $associationMappings = array_filter( |
| 2250 | 2250 | $class->associationMappings, |
| 2251 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2251 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2252 | 2252 | ); |
| 2253 | 2253 | |
| 2254 | 2254 | $entitiesToCascade = array(); |
| 2255 | 2255 | |
| 2256 | 2256 | foreach ($associationMappings as $assoc) { |
| 2257 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2257 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2258 | 2258 | $entity->__load(); |
| 2259 | 2259 | } |
| 2260 | 2260 | |
@@ -2318,7 +2318,7 @@ discard block |
||
| 2318 | 2318 | return; |
| 2319 | 2319 | } |
| 2320 | 2320 | |
| 2321 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2321 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2322 | 2322 | $entity->__load(); |
| 2323 | 2323 | } |
| 2324 | 2324 | |
@@ -2333,7 +2333,7 @@ discard block |
||
| 2333 | 2333 | case LockMode::NONE === $lockMode: |
| 2334 | 2334 | case LockMode::PESSIMISTIC_READ === $lockMode: |
| 2335 | 2335 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
| 2336 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
| 2336 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 2337 | 2337 | throw TransactionRequiredException::transactionRequired(); |
| 2338 | 2338 | } |
| 2339 | 2339 | |
@@ -2369,7 +2369,7 @@ discard block |
||
| 2369 | 2369 | */ |
| 2370 | 2370 | public function clear($entityName = null) |
| 2371 | 2371 | { |
| 2372 | - if ($entityName !== null && !is_string($entityName)) { |
|
| 2372 | + if ($entityName !== null && ! is_string($entityName)) { |
|
| 2373 | 2373 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to %s() must be a string, %s given', __METHOD__, gettype($entityName))); |
| 2374 | 2374 | } |
| 2375 | 2375 | |
@@ -2671,7 +2671,7 @@ discard block |
||
| 2671 | 2671 | // then we can append this entity for eager loading! |
| 2672 | 2672 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
| 2673 | 2673 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2674 | - !$targetClass->isIdentifierComposite && |
|
| 2674 | + ! $targetClass->isIdentifierComposite && |
|
| 2675 | 2675 | $newValue instanceof Proxy && |
| 2676 | 2676 | $newValue->__isInitialized__ === false) { |
| 2677 | 2677 | |
@@ -3038,7 +3038,7 @@ discard block |
||
| 3038 | 3038 | public function getCollectionPersister(array $association) |
| 3039 | 3039 | { |
| 3040 | 3040 | $role = isset($association['cache']) |
| 3041 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
| 3041 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
| 3042 | 3042 | : $association['type']; |
| 3043 | 3043 | |
| 3044 | 3044 | if (isset($this->collectionPersisters[$role])) { |
@@ -3256,7 +3256,7 @@ discard block |
||
| 3256 | 3256 | */ |
| 3257 | 3257 | private function afterTransactionComplete() |
| 3258 | 3258 | { |
| 3259 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3259 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3260 | 3260 | $persister->afterTransactionComplete(); |
| 3261 | 3261 | }); |
| 3262 | 3262 | } |
@@ -3266,7 +3266,7 @@ discard block |
||
| 3266 | 3266 | */ |
| 3267 | 3267 | private function afterTransactionRolledBack() |
| 3268 | 3268 | { |
| 3269 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3269 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3270 | 3270 | $persister->afterTransactionRolledBack(); |
| 3271 | 3271 | }); |
| 3272 | 3272 | } |
@@ -3365,7 +3365,7 @@ discard block |
||
| 3365 | 3365 | if ($other === null) { |
| 3366 | 3366 | $prop->setValue($managedCopy, null); |
| 3367 | 3367 | } else { |
| 3368 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
| 3368 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
| 3369 | 3369 | // do not merge fields marked lazy that have not been fetched. |
| 3370 | 3370 | continue; |
| 3371 | 3371 | } |
@@ -3452,7 +3452,7 @@ discard block |
||
| 3452 | 3452 | */ |
| 3453 | 3453 | private function clearIdentityMapForEntityName($entityName) |
| 3454 | 3454 | { |
| 3455 | - if (! isset($this->identityMap[$entityName])) { |
|
| 3455 | + if ( ! isset($this->identityMap[$entityName])) { |
|
| 3456 | 3456 | return; |
| 3457 | 3457 | } |
| 3458 | 3458 | |
@@ -38,7 +38,6 @@ |
||
| 38 | 38 | * Dequeue an exception for a specific method invocation |
| 39 | 39 | * |
| 40 | 40 | * @param string $method |
| 41 | - * @param mixed $default |
|
| 42 | 41 | * |
| 43 | 42 | * @return mixed |
| 44 | 43 | */ |
@@ -28,6 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * {@inheritdoc} |
| 31 | + * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity |
|
| 31 | 32 | */ |
| 32 | 33 | public function getEntityChangeSet($entity) |
| 33 | 34 | { |