@@ -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; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | } |
339 | 339 | |
340 | - if (!$this->entityInsertions && !$this->entityDeletions && !$this->entityUpdates && !$this->collectionUpdates && !$this->collectionDeletions && !$this->orphanRemovals) { |
|
340 | + if ( ! $this->entityInsertions && ! $this->entityDeletions && ! $this->entityUpdates && ! $this->collectionUpdates && ! $this->collectionDeletions && ! $this->orphanRemovals) { |
|
341 | 341 | $this->dispatchOnFlushEvent(); |
342 | 342 | $this->dispatchPostFlushEvent(); |
343 | 343 | |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | $state = $this->getEntityState($entity); |
459 | 459 | |
460 | 460 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
461 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
461 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | $oid = spl_object_hash($entity); |
515 | 515 | $data = array(); |
516 | 516 | |
517 | - if (!isset($this->entityChangeSets[$oid])) { |
|
517 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
518 | 518 | return $data; |
519 | 519 | } |
520 | 520 | |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | if ($owner === null) { // cloned |
678 | 678 | $actualValue->setOwner($entity, $assoc); |
679 | 679 | } else if ($owner !== $entity) { // no clone, we have to fix |
680 | - if (!$actualValue->isInitialized()) { |
|
680 | + if ( ! $actualValue->isInitialized()) { |
|
681 | 681 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
682 | 682 | } |
683 | 683 | $newValue = clone $actualValue; |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
824 | 824 | |
825 | 825 | foreach ($unwrappedValue as $key => $entry) { |
826 | - if (! ($entry instanceof $targetClass->name)) { |
|
826 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
827 | 827 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
828 | 828 | } |
829 | 829 | |
@@ -1151,7 +1151,7 @@ discard block |
||
1151 | 1151 | |
1152 | 1152 | $joinColumns = reset($assoc['joinColumns']); |
1153 | 1153 | |
1154 | - $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable'])); |
|
1154 | + $calc->addDependency($targetClass->name, $class->name, (int) empty($joinColumns['nullable'])); |
|
1155 | 1155 | |
1156 | 1156 | // If the target class has mapped subclasses, these share the same dependency. |
1157 | 1157 | if ( ! $targetClass->subClasses) { |
@@ -1678,7 +1678,7 @@ discard block |
||
1678 | 1678 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
1679 | 1679 | |
1680 | 1680 | default: |
1681 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1681 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1682 | 1682 | } |
1683 | 1683 | |
1684 | 1684 | $this->cascadePersist($entity, $visited); |
@@ -1748,7 +1748,7 @@ discard block |
||
1748 | 1748 | case self::STATE_DETACHED: |
1749 | 1749 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
1750 | 1750 | default: |
1751 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1751 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1752 | 1752 | } |
1753 | 1753 | |
1754 | 1754 | } |
@@ -1899,7 +1899,7 @@ discard block |
||
1899 | 1899 | */ |
1900 | 1900 | private function isLoaded($entity) |
1901 | 1901 | { |
1902 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
1902 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
1903 | 1903 | } |
1904 | 1904 | |
1905 | 1905 | /** |
@@ -2057,7 +2057,7 @@ discard block |
||
2057 | 2057 | |
2058 | 2058 | $associationMappings = array_filter( |
2059 | 2059 | $class->associationMappings, |
2060 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
2060 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
2061 | 2061 | ); |
2062 | 2062 | |
2063 | 2063 | foreach ($associationMappings as $assoc) { |
@@ -2100,7 +2100,7 @@ discard block |
||
2100 | 2100 | |
2101 | 2101 | $associationMappings = array_filter( |
2102 | 2102 | $class->associationMappings, |
2103 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
2103 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
2104 | 2104 | ); |
2105 | 2105 | |
2106 | 2106 | foreach ($associationMappings as $assoc) { |
@@ -2144,7 +2144,7 @@ discard block |
||
2144 | 2144 | |
2145 | 2145 | $associationMappings = array_filter( |
2146 | 2146 | $class->associationMappings, |
2147 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
2147 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
2148 | 2148 | ); |
2149 | 2149 | |
2150 | 2150 | foreach ($associationMappings as $assoc) { |
@@ -2183,7 +2183,7 @@ discard block |
||
2183 | 2183 | |
2184 | 2184 | $associationMappings = array_filter( |
2185 | 2185 | $class->associationMappings, |
2186 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
2186 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
2187 | 2187 | ); |
2188 | 2188 | |
2189 | 2189 | foreach ($associationMappings as $assoc) { |
@@ -2212,7 +2212,7 @@ discard block |
||
2212 | 2212 | break; |
2213 | 2213 | |
2214 | 2214 | case ($relatedEntities !== null): |
2215 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2215 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2216 | 2216 | throw ORMInvalidArgumentException::invalidAssociation( |
2217 | 2217 | $this->em->getClassMetadata($assoc['targetEntity']), |
2218 | 2218 | $assoc, |
@@ -2243,13 +2243,13 @@ discard block |
||
2243 | 2243 | |
2244 | 2244 | $associationMappings = array_filter( |
2245 | 2245 | $class->associationMappings, |
2246 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
2246 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
2247 | 2247 | ); |
2248 | 2248 | |
2249 | 2249 | $entitiesToCascade = array(); |
2250 | 2250 | |
2251 | 2251 | foreach ($associationMappings as $assoc) { |
2252 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2252 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2253 | 2253 | $entity->__load(); |
2254 | 2254 | } |
2255 | 2255 | |
@@ -2313,7 +2313,7 @@ discard block |
||
2313 | 2313 | return; |
2314 | 2314 | } |
2315 | 2315 | |
2316 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2316 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2317 | 2317 | $entity->__load(); |
2318 | 2318 | } |
2319 | 2319 | |
@@ -2328,7 +2328,7 @@ discard block |
||
2328 | 2328 | case LockMode::NONE === $lockMode: |
2329 | 2329 | case LockMode::PESSIMISTIC_READ === $lockMode: |
2330 | 2330 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
2331 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
2331 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
2332 | 2332 | throw TransactionRequiredException::transactionRequired(); |
2333 | 2333 | } |
2334 | 2334 | |
@@ -2662,7 +2662,7 @@ discard block |
||
2662 | 2662 | // then we can append this entity for eager loading! |
2663 | 2663 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
2664 | 2664 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2665 | - !$targetClass->isIdentifierComposite && |
|
2665 | + ! $targetClass->isIdentifierComposite && |
|
2666 | 2666 | $newValue instanceof Proxy && |
2667 | 2667 | $newValue->__isInitialized__ === false) { |
2668 | 2668 | |
@@ -3029,7 +3029,7 @@ discard block |
||
3029 | 3029 | public function getCollectionPersister(array $association) |
3030 | 3030 | { |
3031 | 3031 | $role = isset($association['cache']) |
3032 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
3032 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
3033 | 3033 | : $association['type']; |
3034 | 3034 | |
3035 | 3035 | if (isset($this->collectionPersisters[$role])) { |
@@ -3247,7 +3247,7 @@ discard block |
||
3247 | 3247 | */ |
3248 | 3248 | private function afterTransactionComplete() |
3249 | 3249 | { |
3250 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
3250 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
3251 | 3251 | $persister->afterTransactionComplete(); |
3252 | 3252 | }); |
3253 | 3253 | } |
@@ -3257,7 +3257,7 @@ discard block |
||
3257 | 3257 | */ |
3258 | 3258 | private function afterTransactionRolledBack() |
3259 | 3259 | { |
3260 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
3260 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
3261 | 3261 | $persister->afterTransactionRolledBack(); |
3262 | 3262 | }); |
3263 | 3263 | } |
@@ -3356,7 +3356,7 @@ discard block |
||
3356 | 3356 | if ($other === null) { |
3357 | 3357 | $prop->setValue($managedCopy, null); |
3358 | 3358 | } else { |
3359 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
3359 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
3360 | 3360 | // do not merge fields marked lazy that have not been fetched. |
3361 | 3361 | continue; |
3362 | 3362 | } |
@@ -3443,7 +3443,7 @@ discard block |
||
3443 | 3443 | */ |
3444 | 3444 | private function clearIdentityMapForEntityName($entityName) |
3445 | 3445 | { |
3446 | - if (! isset($this->identityMap[$entityName])) { |
|
3446 | + if ( ! isset($this->identityMap[$entityName])) { |
|
3447 | 3447 | return; |
3448 | 3448 | } |
3449 | 3449 |
@@ -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 | { |