Completed
Pull Request — master (#1139)
by Asmir
11:11
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   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
         $state = $this->getEntityState($entity);
482 482
 
483 483
         if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) {
484
-            throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity));
484
+            throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity));
485 485
         }
486 486
 
487 487
         $class = $this->em->getClassMetadata(get_class($entity));
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
         $oid  = spl_object_hash($entity);
541 541
         $data = array();
542 542
 
543
-        if (!isset($this->entityChangeSets[$oid])) {
543
+        if ( ! isset($this->entityChangeSets[$oid])) {
544 544
             return $data;
545 545
         }
546 546
 
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
                     if ($owner === null) { // cloned
704 704
                         $actualValue->setOwner($entity, $assoc);
705 705
                     } else if ($owner !== $entity) { // no clone, we have to fix
706
-                        if (!$actualValue->isInitialized()) {
706
+                        if ( ! $actualValue->isInitialized()) {
707 707
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
708 708
                         }
709 709
                         $newValue = clone $actualValue;
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
         $targetClass    = $this->em->getClassMetadata($assoc['targetEntity']);
853 853
 
854 854
         foreach ($unwrappedValue as $key => $entry) {
855
-            if (! ($entry instanceof $targetClass->name)) {
855
+            if ( ! ($entry instanceof $targetClass->name)) {
856 856
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry);
857 857
             }
858 858
 
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 
1181 1181
                 $joinColumns = reset($assoc['joinColumns']);
1182 1182
 
1183
-                $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable']));
1183
+                $calc->addDependency($targetClass->name, $class->name, (int) empty($joinColumns['nullable']));
1184 1184
 
1185 1185
                 // If the target class has mapped subclasses, these share the same dependency.
1186 1186
                 if ( ! $targetClass->subClasses) {
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
         if (isset($this->entityDeletions[$oid])) {
1227 1227
             throw ORMInvalidArgumentException::scheduleInsertForRemovedEntity($entity);
1228 1228
         }
1229
-        if (isset($this->originalEntityData[$oid]) && ! isset($this->entityInsertions[$oid]) && !isset($this->entityShouldBeInserted[$oid])) {
1229
+        if (isset($this->originalEntityData[$oid]) && ! isset($this->entityInsertions[$oid]) && ! isset($this->entityShouldBeInserted[$oid])) {
1230 1230
             throw ORMInvalidArgumentException::scheduleInsertForManagedEntity($entity);
1231 1231
         }
1232 1232
 
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
1713 1713
 
1714 1714
             default:
1715
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1715
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1716 1716
         }
1717 1717
 
1718 1718
         $this->cascadePersist($entity, $visited);
@@ -1782,7 +1782,7 @@  discard block
 block discarded – undo
1782 1782
             case self::STATE_DETACHED:
1783 1783
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
1784 1784
             default:
1785
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1785
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1786 1786
         }
1787 1787
 
1788 1788
     }
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
      */
1934 1934
     private function isLoaded($entity)
1935 1935
     {
1936
-        return !($entity instanceof Proxy) || $entity->__isInitialized();
1936
+        return ! ($entity instanceof Proxy) || $entity->__isInitialized();
1937 1937
     }
1938 1938
 
1939 1939
     /**
@@ -2095,7 +2095,7 @@  discard block
 block discarded – undo
2095 2095
 
2096 2096
         $associationMappings = array_filter(
2097 2097
             $class->associationMappings,
2098
-            function ($assoc) { return $assoc['isCascadeRefresh']; }
2098
+            function($assoc) { return $assoc['isCascadeRefresh']; }
2099 2099
         );
2100 2100
 
2101 2101
         foreach ($associationMappings as $assoc) {
@@ -2138,7 +2138,7 @@  discard block
 block discarded – undo
2138 2138
 
2139 2139
         $associationMappings = array_filter(
2140 2140
             $class->associationMappings,
2141
-            function ($assoc) { return $assoc['isCascadeDetach']; }
2141
+            function($assoc) { return $assoc['isCascadeDetach']; }
2142 2142
         );
2143 2143
 
2144 2144
         foreach ($associationMappings as $assoc) {
@@ -2182,7 +2182,7 @@  discard block
 block discarded – undo
2182 2182
 
2183 2183
         $associationMappings = array_filter(
2184 2184
             $class->associationMappings,
2185
-            function ($assoc) { return $assoc['isCascadeMerge']; }
2185
+            function($assoc) { return $assoc['isCascadeMerge']; }
2186 2186
         );
2187 2187
 
2188 2188
         foreach ($associationMappings as $assoc) {
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 
2222 2222
         $associationMappings = array_filter(
2223 2223
             $class->associationMappings,
2224
-            function ($assoc) { return $assoc['isCascadePersist']; }
2224
+            function($assoc) { return $assoc['isCascadePersist']; }
2225 2225
         );
2226 2226
 
2227 2227
         foreach ($associationMappings as $assoc) {
@@ -2250,7 +2250,7 @@  discard block
 block discarded – undo
2250 2250
                     break;
2251 2251
 
2252 2252
                 case ($relatedEntities !== null):
2253
-                    if (! $relatedEntities instanceof $assoc['targetEntity']) {
2253
+                    if ( ! $relatedEntities instanceof $assoc['targetEntity']) {
2254 2254
                         throw ORMInvalidArgumentException::invalidAssociation(
2255 2255
                             $this->em->getClassMetadata($assoc['targetEntity']),
2256 2256
                             $assoc,
@@ -2281,13 +2281,13 @@  discard block
 block discarded – undo
2281 2281
 
2282 2282
         $associationMappings = array_filter(
2283 2283
             $class->associationMappings,
2284
-            function ($assoc) { return $assoc['isCascadeRemove']; }
2284
+            function($assoc) { return $assoc['isCascadeRemove']; }
2285 2285
         );
2286 2286
 
2287 2287
         $entitiesToCascade = array();
2288 2288
 
2289 2289
         foreach ($associationMappings as $assoc) {
2290
-            if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2290
+            if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2291 2291
                 $entity->__load();
2292 2292
             }
2293 2293
 
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
                     return;
2352 2352
                 }
2353 2353
 
2354
-                if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2354
+                if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2355 2355
                     $entity->__load();
2356 2356
                 }
2357 2357
 
@@ -2366,7 +2366,7 @@  discard block
 block discarded – undo
2366 2366
             case LockMode::NONE === $lockMode:
2367 2367
             case LockMode::PESSIMISTIC_READ === $lockMode:
2368 2368
             case LockMode::PESSIMISTIC_WRITE === $lockMode:
2369
-                if (!$this->em->getConnection()->isTransactionActive()) {
2369
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
2370 2370
                     throw TransactionRequiredException::transactionRequired();
2371 2371
                 }
2372 2372
 
@@ -2701,7 +2701,7 @@  discard block
 block discarded – undo
2701 2701
                             // then we can append this entity for eager loading!
2702 2702
                             if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER &&
2703 2703
                                 isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2704
-                                !$targetClass->isIdentifierComposite &&
2704
+                                ! $targetClass->isIdentifierComposite &&
2705 2705
                                 $newValue instanceof Proxy &&
2706 2706
                                 $newValue->__isInitialized__ === false) {
2707 2707
 
@@ -2998,7 +2998,7 @@  discard block
 block discarded – undo
2998 2998
      */
2999 2999
     public function hasPendingInsertions()
3000 3000
     {
3001
-        return ! empty($this->entityInsertions) || !empty($this->entityShouldBeInserted);
3001
+        return ! empty($this->entityInsertions) || ! empty($this->entityShouldBeInserted);
3002 3002
     }
3003 3003
 
3004 3004
     /**
@@ -3068,7 +3068,7 @@  discard block
 block discarded – undo
3068 3068
     public function getCollectionPersister(array $association)
3069 3069
     {
3070 3070
         $role = isset($association['cache'])
3071
-            ? $association['sourceEntity'] . '::' . $association['fieldName']
3071
+            ? $association['sourceEntity'].'::'.$association['fieldName']
3072 3072
             : $association['type'];
3073 3073
 
3074 3074
         if (isset($this->collectionPersisters[$role])) {
@@ -3286,7 +3286,7 @@  discard block
 block discarded – undo
3286 3286
      */
3287 3287
     private function afterTransactionComplete()
3288 3288
     {
3289
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3289
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3290 3290
             $persister->afterTransactionComplete();
3291 3291
         });
3292 3292
     }
@@ -3296,7 +3296,7 @@  discard block
 block discarded – undo
3296 3296
      */
3297 3297
     private function afterTransactionRolledBack()
3298 3298
     {
3299
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3299
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3300 3300
             $persister->afterTransactionRolledBack();
3301 3301
         });
3302 3302
     }
@@ -3395,7 +3395,7 @@  discard block
 block discarded – undo
3395 3395
                     if ($other === null) {
3396 3396
                         $prop->setValue($managedCopy, null);
3397 3397
                     } else {
3398
-                        if ($other instanceof Proxy && !$other->__isInitialized()) {
3398
+                        if ($other instanceof Proxy && ! $other->__isInitialized()) {
3399 3399
                             // do not merge fields marked lazy that have not been fetched.
3400 3400
                             continue;
3401 3401
                         }
@@ -3482,7 +3482,7 @@  discard block
 block discarded – undo
3482 3482
      */
3483 3483
     private function clearIdentityMapForEntityName($entityName)
3484 3484
     {
3485
-        if (! isset($this->identityMap[$entityName])) {
3485
+        if ( ! isset($this->identityMap[$entityName])) {
3486 3486
             return;
3487 3487
         }
3488 3488
 
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.