Completed
Pull Request — master (#5938)
by Maximilian
16:49 queued 08:43
created
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     protected function onNotFoundMetadata($className)
107 107
     {
108
-        if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) {
108
+        if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) {
109 109
             return;
110 110
         }
111 111
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             $this->completeIdGeneratorMapping($class);
163 163
         }
164 164
 
165
-        if (!$class->isMappedSuperclass) {
165
+        if ( ! $class->isMappedSuperclass) {
166 166
             foreach ($class->embeddedClasses as $property => $embeddableClass) {
167 167
 
168 168
                 if (isset($embeddableClass['inherited'])) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
                 $identifier = $embeddableMetadata->getIdentifier();
189 189
 
190
-                if (! empty($identifier)) {
190
+                if ( ! empty($identifier)) {
191 191
                     $this->inheritIdGeneratorMapping($class, $embeddableMetadata);
192 192
                 }
193 193
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      */
258 258
     protected function validateRuntimeMetadata($class, $parent)
259 259
     {
260
-        if ( ! $class->reflClass ) {
260
+        if ( ! $class->reflClass) {
261 261
             // only validate if there is a reflection class instance
262 262
             return;
263 263
         }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         $class->validateLifecycleCallbacks($this->getReflectionService());
268 268
 
269 269
         // verify inheritance
270
-        if ( ! $class->isMappedSuperclass && !$class->isInheritanceTypeNone()) {
270
+        if ( ! $class->isMappedSuperclass && ! $class->isInheritanceTypeNone()) {
271 271
             if ( ! $parent) {
272 272
                 if (count($class->discriminatorMap) == 0) {
273 273
                     throw MappingException::missingDiscriminatorMap($class->name);
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
     {
429 429
         foreach ($parentClass->associationMappings as $field => $mapping) {
430 430
             if ($parentClass->isMappedSuperclass) {
431
-                if ($mapping['type'] & ClassMetadata::TO_MANY && !$mapping['isOwningSide']) {
431
+                if ($mapping['type'] & ClassMetadata::TO_MANY && ! $mapping['isOwningSide']) {
432 432
                     throw MappingException::illegalToManyAssociationOnMappedSuperclass($parentClass->name, $field);
433 433
                 }
434 434
                 $mapping['sourceEntity'] = $subClass->name;
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
             $embeddableMetadata = $this->getMetadataFor($embeddableClass['class']);
477 477
 
478 478
             $parentClass->mapEmbedded(array(
479
-                'fieldName' => $prefix . '.' . $property,
479
+                'fieldName' => $prefix.'.'.$property,
480 480
                 'class' => $embeddableMetadata->name,
481 481
                 'columnPrefix' => $embeddableClass['columnPrefix'],
482 482
                 'declaredField' => $embeddableClass['declaredField']
483
-                        ? $prefix . '.' . $embeddableClass['declaredField']
483
+                        ? $prefix.'.'.$embeddableClass['declaredField']
484 484
                         : $prefix,
485 485
                 'originalField' => $embeddableClass['originalField'] ?: $property,
486 486
             ));
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
      */
498 498
     private function addInheritedIndexes(ClassMetadata $subClass, ClassMetadata $parentClass)
499 499
     {
500
-        if (! $parentClass->isMappedSuperclass) {
500
+        if ( ! $parentClass->isMappedSuperclass) {
501 501
             return;
502 502
         }
503 503
 
@@ -696,14 +696,14 @@  discard block
 block discarded – undo
696 696
             case ClassMetadata::GENERATOR_TYPE_CUSTOM:
697 697
                 $definition = $class->customGeneratorDefinition;
698 698
                 if ( ! class_exists($definition['class'])) {
699
-                    throw new ORMException("Can't instantiate custom generator : " .
699
+                    throw new ORMException("Can't instantiate custom generator : ".
700 700
                         $definition['class']);
701 701
                 }
702 702
                 $class->setIdGenerator(new $definition['class']);
703 703
                 break;
704 704
 
705 705
             default:
706
-                throw new ORMException("Unknown generator type: " . $class->generatorType);
706
+                throw new ORMException("Unknown generator type: ".$class->generatorType);
707 707
         }
708 708
     }
709 709
 
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
      */
754 754
     protected function getFqcnFromAlias($namespaceAlias, $simpleClassName)
755 755
     {
756
-        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
756
+        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName;
757 757
     }
758 758
 
759 759
     /**
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
      */
778 778
     private function getTargetPlatform()
779 779
     {
780
-        if (!$this->targetPlatform) {
780
+        if ( ! $this->targetPlatform) {
781 781
             $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform();
782 782
         }
783 783
 
Please login to merge, or discard this patch.
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   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
1683 1683
 
1684 1684
             default:
1685
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1685
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1686 1686
         }
1687 1687
 
1688 1688
         $this->cascadePersist($entity, $visited);
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
             case self::STATE_DETACHED:
1753 1753
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
1754 1754
             default:
1755
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1755
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1756 1756
         }
1757 1757
 
1758 1758
     }
@@ -1903,7 +1903,7 @@  discard block
 block discarded – undo
1903 1903
      */
1904 1904
     private function isLoaded($entity)
1905 1905
     {
1906
-        return !($entity instanceof Proxy) || $entity->__isInitialized();
1906
+        return ! ($entity instanceof Proxy) || $entity->__isInitialized();
1907 1907
     }
1908 1908
 
1909 1909
     /**
@@ -2061,7 +2061,7 @@  discard block
 block discarded – undo
2061 2061
 
2062 2062
         $associationMappings = array_filter(
2063 2063
             $class->associationMappings,
2064
-            function ($assoc) { return $assoc['isCascadeRefresh']; }
2064
+            function($assoc) { return $assoc['isCascadeRefresh']; }
2065 2065
         );
2066 2066
 
2067 2067
         foreach ($associationMappings as $assoc) {
@@ -2104,7 +2104,7 @@  discard block
 block discarded – undo
2104 2104
 
2105 2105
         $associationMappings = array_filter(
2106 2106
             $class->associationMappings,
2107
-            function ($assoc) { return $assoc['isCascadeDetach']; }
2107
+            function($assoc) { return $assoc['isCascadeDetach']; }
2108 2108
         );
2109 2109
 
2110 2110
         foreach ($associationMappings as $assoc) {
@@ -2148,7 +2148,7 @@  discard block
 block discarded – undo
2148 2148
 
2149 2149
         $associationMappings = array_filter(
2150 2150
             $class->associationMappings,
2151
-            function ($assoc) { return $assoc['isCascadeMerge']; }
2151
+            function($assoc) { return $assoc['isCascadeMerge']; }
2152 2152
         );
2153 2153
 
2154 2154
         foreach ($associationMappings as $assoc) {
@@ -2187,7 +2187,7 @@  discard block
 block discarded – undo
2187 2187
 
2188 2188
         $associationMappings = array_filter(
2189 2189
             $class->associationMappings,
2190
-            function ($assoc) { return $assoc['isCascadePersist']; }
2190
+            function($assoc) { return $assoc['isCascadePersist']; }
2191 2191
         );
2192 2192
 
2193 2193
         foreach ($associationMappings as $assoc) {
@@ -2216,7 +2216,7 @@  discard block
 block discarded – undo
2216 2216
                     break;
2217 2217
 
2218 2218
                 case ($relatedEntities !== null):
2219
-                    if (! $relatedEntities instanceof $assoc['targetEntity']) {
2219
+                    if ( ! $relatedEntities instanceof $assoc['targetEntity']) {
2220 2220
                         throw ORMInvalidArgumentException::invalidAssociation(
2221 2221
                             $this->em->getClassMetadata($assoc['targetEntity']),
2222 2222
                             $assoc,
@@ -2247,13 +2247,13 @@  discard block
 block discarded – undo
2247 2247
 
2248 2248
         $associationMappings = array_filter(
2249 2249
             $class->associationMappings,
2250
-            function ($assoc) { return $assoc['isCascadeRemove']; }
2250
+            function($assoc) { return $assoc['isCascadeRemove']; }
2251 2251
         );
2252 2252
 
2253 2253
         $entitiesToCascade = array();
2254 2254
 
2255 2255
         foreach ($associationMappings as $assoc) {
2256
-            if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2256
+            if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2257 2257
                 $entity->__load();
2258 2258
             }
2259 2259
 
@@ -2317,7 +2317,7 @@  discard block
 block discarded – undo
2317 2317
                     return;
2318 2318
                 }
2319 2319
 
2320
-                if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2320
+                if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2321 2321
                     $entity->__load();
2322 2322
                 }
2323 2323
 
@@ -2332,7 +2332,7 @@  discard block
 block discarded – undo
2332 2332
             case LockMode::NONE === $lockMode:
2333 2333
             case LockMode::PESSIMISTIC_READ === $lockMode:
2334 2334
             case LockMode::PESSIMISTIC_WRITE === $lockMode:
2335
-                if (!$this->em->getConnection()->isTransactionActive()) {
2335
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
2336 2336
                     throw TransactionRequiredException::transactionRequired();
2337 2337
                 }
2338 2338
 
@@ -2666,7 +2666,7 @@  discard block
 block discarded – undo
2666 2666
                             // then we can append this entity for eager loading!
2667 2667
                             if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER &&
2668 2668
                                 isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2669
-                                !$targetClass->isIdentifierComposite &&
2669
+                                ! $targetClass->isIdentifierComposite &&
2670 2670
                                 $newValue instanceof Proxy &&
2671 2671
                                 $newValue->__isInitialized__ === false) {
2672 2672
 
@@ -3033,7 +3033,7 @@  discard block
 block discarded – undo
3033 3033
     public function getCollectionPersister(array $association)
3034 3034
     {
3035 3035
         $role = isset($association['cache'])
3036
-            ? $association['sourceEntity'] . '::' . $association['fieldName']
3036
+            ? $association['sourceEntity'].'::'.$association['fieldName']
3037 3037
             : $association['type'];
3038 3038
 
3039 3039
         if (isset($this->collectionPersisters[$role])) {
@@ -3251,7 +3251,7 @@  discard block
 block discarded – undo
3251 3251
      */
3252 3252
     private function afterTransactionComplete()
3253 3253
     {
3254
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3254
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3255 3255
             $persister->afterTransactionComplete();
3256 3256
         });
3257 3257
     }
@@ -3261,7 +3261,7 @@  discard block
 block discarded – undo
3261 3261
      */
3262 3262
     private function afterTransactionRolledBack()
3263 3263
     {
3264
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3264
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3265 3265
             $persister->afterTransactionRolledBack();
3266 3266
         });
3267 3267
     }
@@ -3360,7 +3360,7 @@  discard block
 block discarded – undo
3360 3360
                     if ($other === null) {
3361 3361
                         $prop->setValue($managedCopy, null);
3362 3362
                     } else {
3363
-                        if ($other instanceof Proxy && !$other->__isInitialized()) {
3363
+                        if ($other instanceof Proxy && ! $other->__isInitialized()) {
3364 3364
                             // do not merge fields marked lazy that have not been fetched.
3365 3365
                             continue;
3366 3366
                         }
@@ -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.