Completed
Pull Request — master (#6055)
by Martin
71:23 queued 62:58
created
lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
ORM/Cache/Persister/Collection/ReadOnlyCachedCollectionPersister.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -715,9 +715,9 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -220,7 +220,7 @@
 block discarded – undo
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 {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/Expr/GroupBy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     /**
34 34
      * @var string
35 35
      */
36
-    protected $preSeparator  = '';
36
+    protected $preSeparator = '';
37 37
 
38 38
     /**
39 39
      * @var string
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Pagination/Paginator.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
lib/Doctrine/ORM/UnitOfWork.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -337,12 +337,12 @@  discard block
 block discarded – undo
337 337
             }
338 338
         }
339 339
 
340
-        if (!$this->entityInsertions &&
341
-            !$this->entityDeletions &&
342
-            !$this->entityUpdates &&
343
-            !$this->collectionUpdates &&
344
-            !$this->collectionDeletions &&
345
-            !$this->orphanRemovals) {
340
+        if ( ! $this->entityInsertions &&
341
+            ! $this->entityDeletions &&
342
+            ! $this->entityUpdates &&
343
+            ! $this->collectionUpdates &&
344
+            ! $this->collectionDeletions &&
345
+            ! $this->orphanRemovals) {
346 346
 
347 347
             $this->dispatchOnFlushEvent();
348 348
             $this->dispatchPostFlushEvent();
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
         $state = $this->getEntityState($entity);
465 465
 
466 466
         if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) {
467
-            throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity));
467
+            throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity));
468 468
         }
469 469
 
470 470
         $class = $this->em->getClassMetadata(get_class($entity));
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
         $oid  = spl_object_hash($entity);
521 521
         $data = array();
522 522
 
523
-        if (!isset($this->entityChangeSets[$oid])) {
523
+        if ( ! isset($this->entityChangeSets[$oid])) {
524 524
             return $data;
525 525
         }
526 526
 
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
                     if ($owner === null) { // cloned
684 684
                         $actualValue->setOwner($entity, $assoc);
685 685
                     } else if ($owner !== $entity) { // no clone, we have to fix
686
-                        if (!$actualValue->isInitialized()) {
686
+                        if ( ! $actualValue->isInitialized()) {
687 687
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
688 688
                         }
689 689
                         $newValue = clone $actualValue;
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
         $targetClass    = $this->em->getClassMetadata($assoc['targetEntity']);
830 830
 
831 831
         foreach ($unwrappedValue as $key => $entry) {
832
-            if (! ($entry instanceof $targetClass->name)) {
832
+            if ( ! ($entry instanceof $targetClass->name)) {
833 833
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry);
834 834
             }
835 835
 
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
 
1158 1158
                 $joinColumns = reset($assoc['joinColumns']);
1159 1159
 
1160
-                $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable']));
1160
+                $calc->addDependency($targetClass->name, $class->name, (int) empty($joinColumns['nullable']));
1161 1161
 
1162 1162
                 // If the target class has mapped subclasses, these share the same dependency.
1163 1163
                 if ( ! $targetClass->subClasses) {
@@ -1684,7 +1684,7 @@  discard block
 block discarded – undo
1684 1684
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
1685 1685
 
1686 1686
             default:
1687
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1687
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1688 1688
         }
1689 1689
 
1690 1690
         $this->cascadePersist($entity, $visited);
@@ -1754,7 +1754,7 @@  discard block
 block discarded – undo
1754 1754
             case self::STATE_DETACHED:
1755 1755
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
1756 1756
             default:
1757
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1757
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1758 1758
         }
1759 1759
 
1760 1760
     }
@@ -1905,7 +1905,7 @@  discard block
 block discarded – undo
1905 1905
      */
1906 1906
     private function isLoaded($entity)
1907 1907
     {
1908
-        return !($entity instanceof Proxy) || $entity->__isInitialized();
1908
+        return ! ($entity instanceof Proxy) || $entity->__isInitialized();
1909 1909
     }
1910 1910
 
1911 1911
     /**
@@ -2063,7 +2063,7 @@  discard block
 block discarded – undo
2063 2063
 
2064 2064
         $associationMappings = array_filter(
2065 2065
             $class->associationMappings,
2066
-            function ($assoc) { return $assoc['isCascadeRefresh']; }
2066
+            function($assoc) { return $assoc['isCascadeRefresh']; }
2067 2067
         );
2068 2068
 
2069 2069
         foreach ($associationMappings as $assoc) {
@@ -2106,7 +2106,7 @@  discard block
 block discarded – undo
2106 2106
 
2107 2107
         $associationMappings = array_filter(
2108 2108
             $class->associationMappings,
2109
-            function ($assoc) { return $assoc['isCascadeDetach']; }
2109
+            function($assoc) { return $assoc['isCascadeDetach']; }
2110 2110
         );
2111 2111
 
2112 2112
         foreach ($associationMappings as $assoc) {
@@ -2150,7 +2150,7 @@  discard block
 block discarded – undo
2150 2150
 
2151 2151
         $associationMappings = array_filter(
2152 2152
             $class->associationMappings,
2153
-            function ($assoc) { return $assoc['isCascadeMerge']; }
2153
+            function($assoc) { return $assoc['isCascadeMerge']; }
2154 2154
         );
2155 2155
 
2156 2156
         foreach ($associationMappings as $assoc) {
@@ -2189,7 +2189,7 @@  discard block
 block discarded – undo
2189 2189
 
2190 2190
         $associationMappings = array_filter(
2191 2191
             $class->associationMappings,
2192
-            function ($assoc) { return $assoc['isCascadePersist']; }
2192
+            function($assoc) { return $assoc['isCascadePersist']; }
2193 2193
         );
2194 2194
 
2195 2195
         foreach ($associationMappings as $assoc) {
@@ -2218,7 +2218,7 @@  discard block
 block discarded – undo
2218 2218
                     break;
2219 2219
 
2220 2220
                 case ($relatedEntities !== null):
2221
-                    if (! $relatedEntities instanceof $assoc['targetEntity']) {
2221
+                    if ( ! $relatedEntities instanceof $assoc['targetEntity']) {
2222 2222
                         throw ORMInvalidArgumentException::invalidAssociation(
2223 2223
                             $this->em->getClassMetadata($assoc['targetEntity']),
2224 2224
                             $assoc,
@@ -2249,13 +2249,13 @@  discard block
 block discarded – undo
2249 2249
 
2250 2250
         $associationMappings = array_filter(
2251 2251
             $class->associationMappings,
2252
-            function ($assoc) { return $assoc['isCascadeRemove']; }
2252
+            function($assoc) { return $assoc['isCascadeRemove']; }
2253 2253
         );
2254 2254
 
2255 2255
         $entitiesToCascade = array();
2256 2256
 
2257 2257
         foreach ($associationMappings as $assoc) {
2258
-            if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2258
+            if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2259 2259
                 $entity->__load();
2260 2260
             }
2261 2261
 
@@ -2319,7 +2319,7 @@  discard block
 block discarded – undo
2319 2319
                     return;
2320 2320
                 }
2321 2321
 
2322
-                if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2322
+                if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2323 2323
                     $entity->__load();
2324 2324
                 }
2325 2325
 
@@ -2334,7 +2334,7 @@  discard block
 block discarded – undo
2334 2334
             case LockMode::NONE === $lockMode:
2335 2335
             case LockMode::PESSIMISTIC_READ === $lockMode:
2336 2336
             case LockMode::PESSIMISTIC_WRITE === $lockMode:
2337
-                if (!$this->em->getConnection()->isTransactionActive()) {
2337
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
2338 2338
                     throw TransactionRequiredException::transactionRequired();
2339 2339
                 }
2340 2340
 
@@ -2668,7 +2668,7 @@  discard block
 block discarded – undo
2668 2668
                             // then we can append this entity for eager loading!
2669 2669
                             if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER &&
2670 2670
                                 isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2671
-                                !$targetClass->isIdentifierComposite &&
2671
+                                ! $targetClass->isIdentifierComposite &&
2672 2672
                                 $newValue instanceof Proxy &&
2673 2673
                                 $newValue->__isInitialized__ === false) {
2674 2674
 
@@ -3035,7 +3035,7 @@  discard block
 block discarded – undo
3035 3035
     public function getCollectionPersister(array $association)
3036 3036
     {
3037 3037
         $role = isset($association['cache'])
3038
-            ? $association['sourceEntity'] . '::' . $association['fieldName']
3038
+            ? $association['sourceEntity'].'::'.$association['fieldName']
3039 3039
             : $association['type'];
3040 3040
 
3041 3041
         if (isset($this->collectionPersisters[$role])) {
@@ -3253,7 +3253,7 @@  discard block
 block discarded – undo
3253 3253
      */
3254 3254
     private function afterTransactionComplete()
3255 3255
     {
3256
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3256
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3257 3257
             $persister->afterTransactionComplete();
3258 3258
         });
3259 3259
     }
@@ -3263,7 +3263,7 @@  discard block
 block discarded – undo
3263 3263
      */
3264 3264
     private function afterTransactionRolledBack()
3265 3265
     {
3266
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3266
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3267 3267
             $persister->afterTransactionRolledBack();
3268 3268
         });
3269 3269
     }
@@ -3362,7 +3362,7 @@  discard block
 block discarded – undo
3362 3362
                     if ($other === null) {
3363 3363
                         $prop->setValue($managedCopy, null);
3364 3364
                     } else {
3365
-                        if ($other instanceof Proxy && !$other->__isInitialized()) {
3365
+                        if ($other instanceof Proxy && ! $other->__isInitialized()) {
3366 3366
                             // do not merge fields marked lazy that have not been fetched.
3367 3367
                             continue;
3368 3368
                         }
@@ -3449,7 +3449,7 @@  discard block
 block discarded – undo
3449 3449
      */
3450 3450
     private function clearIdentityMapForEntityName($entityName)
3451 3451
     {
3452
-        if (! isset($this->identityMap[$entityName])) {
3452
+        if ( ! isset($this->identityMap[$entityName])) {
3453 3453
             return;
3454 3454
         }
3455 3455
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Mocks/ConcurrentRegionMock.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,6 @@
 block discarded – undo
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
      */
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -28,6 +28,7 @@
 block discarded – undo
28 28
 
29 29
     /**
30 30
      * {@inheritdoc}
31
+     * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity
31 32
      */
32 33
     public function getEntityChangeSet($entity)
33 34
     {
Please login to merge, or discard this patch.