Completed
Pull Request — 2.5 (#7639)
by
unknown
03:04
created
lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,6 @@
 block discarded – undo
21 21
 namespace Doctrine\ORM\Cache;
22 22
 
23 23
 use Doctrine\Common\Util\ClassUtils;
24
-
25 24
 use Doctrine\ORM\Query;
26 25
 use Doctrine\ORM\Mapping\ClassMetadata;
27 26
 use Doctrine\ORM\EntityManagerInterface;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                 continue;
82 82
             }
83 83
 
84
-            if (! ($assoc['type'] & ClassMetadata::TO_ONE)) {
84
+            if ( ! ($assoc['type'] & ClassMetadata::TO_ONE)) {
85 85
                 unset($data[$name]);
86 86
                 continue;
87 87
             }
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
 
94 94
                 foreach ($associationIds as $fieldName => $fieldValue) {
95 95
 
96
-                    if (isset($targetClassMetadata->associationMappings[$fieldName])){
96
+                    if (isset($targetClassMetadata->associationMappings[$fieldName])) {
97 97
                         $targetAssoc = $targetClassMetadata->associationMappings[$fieldName];
98 98
 
99
-                        foreach($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) {
99
+                        foreach ($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) {
100 100
 
101 101
                             if (isset($targetAssoc['sourceToTargetKeyColumns'][$referencedColumn])) {
102 102
                                 $data[$localColumn] = $fieldValue;
103 103
                             }
104 104
                         }
105
-                    }else{
105
+                    } else {
106 106
                         $data[$assoc['targetToSourceKeyColumns'][$targetClassMetadata->columnNames[$fieldName]]] = $fieldValue;
107 107
                     }
108 108
                 }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         }
154 154
 
155 155
         foreach ($metadata->associationMappings as $name => $assoc) {
156
-            if ( ! isset($assoc['cache']) ||  ! isset($data[$name])) {
156
+            if ( ! isset($assoc['cache']) || ! isset($data[$name])) {
157 157
                 continue;
158 158
             }
159 159
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
                                 $data[$localColumn] = $fieldValue;
103 103
                             }
104 104
                         }
105
-                    }else{
105
+                    } else{
106 106
                         $data[$assoc['targetToSourceKeyColumns'][$targetClassMetadata->columnNames[$fieldName]]] = $fieldValue;
107 107
                     }
108 108
                 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php 4 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,6 @@
 block discarded – undo
31 31
 use Doctrine\ORM\PersistentCollection;
32 32
 use Doctrine\ORM\EntityManagerInterface;
33 33
 use Doctrine\ORM\Persisters\Entity\EntityPersister;
34
-
35 34
 use Doctrine\Common\Util\ClassUtils;
36 35
 use Doctrine\Common\Collections\Criteria;
37 36
 
Please login to merge, or discard this 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.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -291,7 +291,7 @@
 block discarded – undo
291 291
     /**
292 292
      * Generates a string of currently query
293 293
      *
294
-     * @param array $query
294
+     * @param string $query
295 295
      * @param string $criteria
296 296
      * @param array $orderBy
297 297
      * @param integer $limit
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
         if ($class->containsForeignIdentifier) {
238 238
             foreach ($class->associationMappings as $name => $assoc) {
239
-                if (!empty($assoc['id']) && !isset($assoc['cache'])) {
239
+                if ( ! empty($assoc['id']) && ! isset($assoc['cache'])) {
240 240
                     throw CacheException::nonCacheableEntityAssociation($class->name, $name);
241 241
                 }
242 242
             }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
             ? $this->persister->expandCriteriaParameters($criteria)
306 306
             : $this->persister->expandParameters($criteria);
307 307
 
308
-        return sha1($query . serialize($params) . serialize($orderBy) . $limit . $offset);
308
+        return sha1($query.serialize($params).serialize($orderBy).$limit.$offset);
309 309
     }
310 310
 
311 311
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Configuration.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
     /**
92 92
      * Sets the strategy for automatically generating proxy classes.
93 93
      *
94
-     * @param boolean|int $autoGenerate Possible values are constants of Doctrine\Common\Proxy\AbstractProxyFactory.
94
+     * @param boolean $autoGenerate Possible values are constants of Doctrine\Common\Proxy\AbstractProxyFactory.
95 95
      *                                  True is converted to AUTOGENERATE_ALWAYS, false to AUTOGENERATE_NEVER.
96 96
      *
97 97
      * @return void
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function setAutoGenerateProxyClasses($autoGenerate)
100 100
     {
101
-        $this->_attributes['autoGenerateProxyClasses'] = (int)$autoGenerate;
101
+        $this->_attributes['autoGenerateProxyClasses'] = (int) $autoGenerate;
102 102
     }
103 103
 
104 104
     /**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function newDefaultAnnotationDriver($paths = array(), $useSimpleAnnotationReader = true)
153 153
     {
154
-        AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
154
+        AnnotationRegistry::registerFile(__DIR__.'/Mapping/Driver/DoctrineAnnotations.php');
155 155
 
156 156
         if ($useSimpleAnnotationReader) {
157 157
             // Register the ORM Annotations in the AnnotationRegistry
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityRepository.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
 use Doctrine\Common\Persistence\ObjectRepository;
25 25
 use Doctrine\Common\Collections\Selectable;
26 26
 use Doctrine\Common\Collections\Criteria;
27
-use Doctrine\Common\Collections\ArrayCollection;
28 27
 
29 28
 /**
30 29
  * An EntityRepository serves as a repository for entities with generic as well as
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@
 block discarded – undo
231 231
         }
232 232
 
233 233
         if (empty($arguments)) {
234
-            throw ORMException::findByRequiresParameter($method . $by);
234
+            throw ORMException::findByRequiresParameter($method.$by);
235 235
         }
236 236
 
237 237
         $fieldName = lcfirst(\Doctrine\Common\Util\Inflector::classify($by));
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -24,9 +24,6 @@
 block discarded – undo
24 24
 use Doctrine\ORM\Mapping\ClassMetadata;
25 25
 use Doctrine\ORM\PersistentCollection;
26 26
 use Doctrine\ORM\Query;
27
-use Doctrine\ORM\Events;
28
-use Doctrine\ORM\Event\LifecycleEventArgs;
29
-use Doctrine\ORM\Event\PostLoadEventDispatcher;
30 27
 use Doctrine\Common\Collections\ArrayCollection;
31 28
 use Doctrine\ORM\Proxy\Proxy;
32 29
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $class->reflFields[$fieldName]->setValue($entity, $value);
203 203
             $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value);
204 204
 
205
-            $this->initializedCollections[$oid . $fieldName] = $value;
205
+            $this->initializedCollections[$oid.$fieldName] = $value;
206 206
         } else if (
207 207
             isset($this->_hints[Query::HINT_REFRESH]) ||
208 208
             isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) &&
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
             $value->setInitialized(true);
214 214
             $value->unwrap()->clear();
215 215
 
216
-            $this->initializedCollections[$oid . $fieldName] = $value;
216
+            $this->initializedCollections[$oid.$fieldName] = $value;
217 217
         } else {
218 218
             // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN!
219
-            $this->existingCollections[$oid . $fieldName] = $value;
219
+            $this->existingCollections[$oid.$fieldName] = $value;
220 220
         }
221 221
 
222 222
         return $value;
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
             $idHash = '';
290 290
 
291 291
             foreach ($class->identifier as $fieldName) {
292
-                $idHash .= ' ' . (isset($class->associationMappings[$fieldName])
292
+                $idHash .= ' '.(isset($class->associationMappings[$fieldName])
293 293
                     ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']]
294 294
                     : $data[$fieldName]);
295 295
             }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                 $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias];
343 343
                 // we need the $path to save into the identifier map which entities were already
344 344
                 // seen for this parent-child relationship
345
-                $path = $parentAlias . '.' . $dqlAlias;
345
+                $path = $parentAlias.'.'.$dqlAlias;
346 346
 
347 347
                 // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs
348 348
                 if ( ! isset($nonemptyComponents[$parentAlias])) {
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
                     $reflFieldValue = $reflField->getValue($parentObject);
383 383
 
384 384
                     if (isset($nonemptyComponents[$dqlAlias])) {
385
-                        $collKey = $oid . $relationField;
385
+                        $collKey = $oid.$relationField;
386 386
                         if (isset($this->initializedCollections[$collKey])) {
387 387
                             $reflFieldValue = $this->initializedCollections[$collKey];
388 388
                         } else if ( ! isset($this->existingCollections[$collKey])) {
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
                     // PATH B: Single-valued association
431 431
                     $reflFieldValue = $reflField->getValue($parentObject);
432 432
 
433
-                    if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && !$reflFieldValue->__isInitialized__)) {
433
+                    if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized__)) {
434 434
                         // we only need to take action if this value is null,
435 435
                         // we refresh the entity or its an unitialized proxy.
436 436
                         if (isset($nonemptyComponents[$dqlAlias])) {
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
                 $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0;
476 476
 
477 477
                 // if this row has a NULL value for the root result id then make it a null result.
478
-                if ( ! isset($nonemptyComponents[$dqlAlias]) ) {
478
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
479 479
                     if ($this->_rsm->isMixed) {
480 480
                         $result[] = array($entityKey => null);
481 481
                     } else {
@@ -531,13 +531,13 @@  discard block
 block discarded – undo
531 531
             }
532 532
         }
533 533
 
534
-        if ( ! isset($resultKey) ) {
534
+        if ( ! isset($resultKey)) {
535 535
             $this->resultCounter++;
536 536
         }
537 537
 
538 538
         // Append scalar values to mixed result sets
539 539
         if (isset($rowData['scalars'])) {
540
-            if ( ! isset($resultKey) ) {
540
+            if ( ! isset($resultKey)) {
541 541
                 $resultKey = (isset($this->_rsm->indexByMap['scalars']))
542 542
                     ? $row[$this->_rsm->indexByMap['scalars']]
543 543
                     : $this->resultCounter - 1;
@@ -550,19 +550,19 @@  discard block
 block discarded – undo
550 550
 
551 551
         // Append new object to mixed result sets
552 552
         if (isset($rowData['newObjects'])) {
553
-            if ( ! isset($resultKey) ) {
553
+            if ( ! isset($resultKey)) {
554 554
                 $resultKey = $this->resultCounter - 1;
555 555
             }
556 556
 
557 557
 
558
-            $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0);
558
+            $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0);
559 559
 
560 560
             foreach ($rowData['newObjects'] as $objIndex => $newObject) {
561 561
                 $class  = $newObject['class'];
562 562
                 $args   = $newObject['args'];
563 563
                 $obj    = $class->newInstanceArgs($args);
564 564
 
565
-                if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) {
565
+                if ($scalarCount == 0 && count($rowData['newObjects']) == 1) {
566 566
                     $result[$resultKey] = $obj;
567 567
 
568 568
                     continue;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 namespace Doctrine\ORM\Internal\Hydration;
21 21
 
22 22
 use PDO;
23
-use Doctrine\DBAL\Types\Type;
24 23
 use Doctrine\ORM\Mapping\ClassMetadata;
25 24
 use Doctrine\ORM\Query;
26 25
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/NamingStrategy.php 1 patch
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -70,8 +70,6 @@
 block discarded – undo
70 70
      * Returns a join column name for a property.
71 71
      *
72 72
      * @param string $propertyName A property name.
73
-     * @param string|null $className    The fully-qualified class name.
74
-     *                                  This parameter is omitted from the signature due to BC
75 73
      *
76 74
      * @return string A join column name.
77 75
      */
Please login to merge, or discard this patch.
lib/Doctrine/ORM/NativeQuery.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     /**
50 50
      * Gets the SQL query.
51 51
      *
52
-     * @return mixed The built SQL query or an array of all SQL queries.
52
+     * @return string The built SQL query or an array of all SQL queries.
53 53
      *
54 54
      * @override
55 55
      */
Please login to merge, or discard this patch.
lib/Doctrine/ORM/PersistentCollection.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -579,7 +579,7 @@
 block discarded – undo
579 579
      * Internal note: Tried to implement Serializable first but that did not work well
580 580
      *                with circular references. This solution seems simpler and works well.
581 581
      *
582
-     * @return array
582
+     * @return string[]
583 583
      */
584 584
     public function __sleep()
585 585
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
      */
401 401
     public function containsKey($key)
402 402
     {
403
-        if (! $this->initialized && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY
403
+        if ( ! $this->initialized && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY
404 404
             && isset($this->association['indexBy'])) {
405 405
             $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
406 406
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
             && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY
434 434
             && isset($this->association['indexBy'])
435 435
         ) {
436
-            if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) {
436
+            if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) {
437 437
                 return $this->em->find($this->typeClass->name, $key);
438 438
             }
439 439
 
Please login to merge, or discard this patch.