Completed
Pull Request — master (#5938)
by Maximilian
16:49 queued 08:43
created
lib/Doctrine/ORM/EntityManagerInterface.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -242,17 +242,17 @@
 block discarded – undo
242 242
     public function getUnitOfWork();
243 243
 
244 244
     /**
245
-    * Gets a hydrator for the given hydration mode.
246
-    *
247
-    * This method caches the hydrator instances which is used for all queries that don't
248
-    * selectively iterate over the result.
249
-    *
250
-    * @deprecated
251
-    *
252
-    * @param int $hydrationMode
253
-    *
254
-    * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator
255
-    */
245
+     * Gets a hydrator for the given hydration mode.
246
+     *
247
+     * This method caches the hydrator instances which is used for all queries that don't
248
+     * selectively iterate over the result.
249
+     *
250
+     * @deprecated
251
+     *
252
+     * @param int $hydrationMode
253
+     *
254
+     * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator
255
+     */
256 256
     public function getHydrator($hydrationMode);
257 257
 
258 258
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
                 // It's a joined result
109 109
 
110 110
                 $parent = $this->_rsm->parentAliasMap[$dqlAlias];
111
-                $path   = $parent . '.' . $dqlAlias;
111
+                $path   = $parent.'.'.$dqlAlias;
112 112
 
113 113
                 // missing parent data, skipping as RIGHT JOIN hydration is not supported.
114
-                if ( ! isset($nonemptyComponents[$parent]) ) {
114
+                if ( ! isset($nonemptyComponents[$parent])) {
115 115
                     continue;
116 116
                 }
117 117
 
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
                 if ($this->_rsm->isMixed && isset($this->_rootAliases[$parent])) {
121 121
                     $first = reset($this->_resultPointers);
122 122
                     // TODO: Exception if $key === null ?
123
-                    $baseElement =& $this->_resultPointers[$parent][key($first)];
123
+                    $baseElement = & $this->_resultPointers[$parent][key($first)];
124 124
                 } else if (isset($this->_resultPointers[$parent])) {
125
-                    $baseElement =& $this->_resultPointers[$parent];
125
+                    $baseElement = & $this->_resultPointers[$parent];
126 126
                 } else {
127 127
                     unset($this->_resultPointers[$dqlAlias]); // Ticket #1228
128 128
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                     }
174 174
                 }
175 175
 
176
-                $coll =& $baseElement[$relationAlias];
176
+                $coll = & $baseElement[$relationAlias];
177 177
 
178 178
                 if (is_array($coll)) {
179 179
                     $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne);
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                 $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0;
186 186
 
187 187
                 // if this row has a NULL value for the root result id then make it a null result.
188
-                if ( ! isset($nonemptyComponents[$dqlAlias]) ) {
188
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
189 189
                     $result[] = $this->_rsm->isMixed
190 190
                         ? array($entityKey => null)
191 191
                         : null;
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
                 $resultKey = $this->_resultCounter - 1;
247 247
             }
248 248
 
249
-            $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0);
249
+            $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0);
250 250
 
251 251
             foreach ($rowData['newObjects'] as $objIndex => $newObject) {
252 252
                 $class  = $newObject['class'];
@@ -284,13 +284,13 @@  discard block
 block discarded – undo
284 284
         }
285 285
 
286 286
         if ($oneToOne) {
287
-            $this->_resultPointers[$dqlAlias] =& $coll;
287
+            $this->_resultPointers[$dqlAlias] = & $coll;
288 288
 
289 289
             return;
290 290
         }
291 291
 
292 292
         if ($index !== false) {
293
-            $this->_resultPointers[$dqlAlias] =& $coll[$index];
293
+            $this->_resultPointers[$dqlAlias] = & $coll[$index];
294 294
 
295 295
             return;
296 296
         }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
         }
301 301
 
302 302
         end($coll);
303
-        $this->_resultPointers[$dqlAlias] =& $coll[key($coll)];
303
+        $this->_resultPointers[$dqlAlias] = & $coll[key($coll)];
304 304
 
305 305
         return;
306 306
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/HydrationException.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@
 block discarded – undo
48 48
      */
49 49
     public static function emptyDiscriminatorValue($dqlAlias)
50 50
     {
51
-        return new self("The DQL alias '" . $dqlAlias . "' contains an entity ".
52
-            "of an inheritance hierarchy with an empty discriminator value. This means " .
53
-            "that the database contains inconsistent data with an empty " .
51
+        return new self("The DQL alias '".$dqlAlias."' contains an entity ".
52
+            "of an inheritance hierarchy with an empty discriminator value. This means ".
53
+            "that the database contains inconsistent data with an empty ".
54 54
             "discriminator value in a table row."
55 55
         );
56 56
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 1 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/AbstractHydrator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                         : $value;
300 300
 
301 301
                     if ($cacheKeyInfo['isIdentifier'] && $value !== null) {
302
-                        $id[$dqlAlias] .= '|' . $value;
302
+                        $id[$dqlAlias] .= '|'.$value;
303 303
                         $nonemptyComponents[$dqlAlias] = true;
304 304
                     }
305 305
                     break;
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
             if ( ! isset($cacheKeyInfo['isScalar'])) {
338 338
                 $dqlAlias  = $cacheKeyInfo['dqlAlias'];
339 339
                 $type      = $cacheKeyInfo['type'];
340
-                $fieldName = $dqlAlias . '_' . $fieldName;
340
+                $fieldName = $dqlAlias.'_'.$fieldName;
341 341
                 $value     = $type
342 342
                     ? $type->convertToPHPValue($value, $this->_platform)
343 343
                     : $value;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/IterableResult.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,6 +105,6 @@
 block discarded – undo
105 105
      */
106 106
     public function valid()
107 107
     {
108
-        return ($this->_current!=false);
108
+        return ($this->_current != false);
109 109
     }
110 110
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query.php 3 patches
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.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     /**
41 41
      * A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts.
42 42
      */
43
-    const STATE_CLEAN  = 1;
43
+    const STATE_CLEAN = 1;
44 44
 
45 45
     /**
46 46
      * A query object is in state DIRTY when it has DQL parts that have not yet been
@@ -707,11 +707,11 @@  discard block
 block discarded – undo
707 707
             ->getName();
708 708
 
709 709
         return md5(
710
-            $this->getDql() . serialize($this->_hints) .
711
-            '&platform=' . $platform .
712
-            ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : '') .
713
-            '&firstResult=' . $this->_firstResult . '&maxResult=' . $this->_maxResults .
714
-            '&hydrationMode=' . $this->_hydrationMode . '&types=' . serialize($this->_parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT'
710
+            $this->getDql().serialize($this->_hints).
711
+            '&platform='.$platform.
712
+            ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : '').
713
+            '&firstResult='.$this->_firstResult.'&maxResult='.$this->_maxResults.
714
+            '&hydrationMode='.$this->_hydrationMode.'&types='.serialize($this->_parsedTypes).'DOCTRINE_QUERY_CACHE_SALT'
715 715
         );
716 716
     }
717 717
 
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
      */
721 721
     protected function getHash()
722 722
     {
723
-        return sha1(parent::getHash(). '-'. $this->_firstResult . '-' . $this->_maxResults);
723
+        return sha1(parent::getHash().'-'.$this->_firstResult.'-'.$this->_maxResults);
724 724
     }
725 725
 
726 726
     /**
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -620,7 +620,7 @@
 block discarded – undo
620 620
      * Executes the query and returns an IterableResult that can be used to incrementally
621 621
      * iterated over the result.
622 622
      *
623
-     * @param ArrayCollection|array|null $parameters    The query parameters.
623
+     * @param null|ArrayCollection $parameters    The query parameters.
624 624
      * @param integer                    $hydrationMode The hydration mode to use.
625 625
      *
626 626
      * @return \Doctrine\ORM\Internal\Hydration\IterableResult
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public function referenceColumnName()
102 102
     {
103
-        return $this->case === CASE_UPPER ?  'ID' : 'id';
103
+        return $this->case === CASE_UPPER ? 'ID' : 'id';
104 104
     }
105 105
 
106 106
     /**
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function joinColumnName($propertyName, $className = null)
110 110
     {
111
-        return $this->underscore($propertyName) . '_' . $this->referenceColumnName();
111
+        return $this->underscore($propertyName).'_'.$this->referenceColumnName();
112 112
     }
113 113
 
114 114
     /**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function joinTableName($sourceEntity, $targetEntity, $propertyName = null)
118 118
     {
119
-        return $this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity);
119
+        return $this->classToTableName($sourceEntity).'_'.$this->classToTableName($targetEntity);
120 120
     }
121 121
     
122 122
     /**
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function joinKeyColumnName($entityName, $referencedColumnName = null)
126 126
     {
127
-        return $this->classToTableName($entityName) . '_' .
127
+        return $this->classToTableName($entityName).'_'.
128 128
                 ($referencedColumnName ?: $this->referenceColumnName());
129 129
     }
130 130
     
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/AnsiQuoteStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,6 +91,6 @@
 block discarded – undo
91 91
      */
92 92
     public function getColumnAlias($columnName, $counter, AbstractPlatform $platform, ClassMetadata $class = null)
93 93
     {
94
-        return $platform->getSQLResultCasing($columnName . '_' . $counter);
94
+        return $platform->getSQLResultCasing($columnName.'_'.$counter);
95 95
     }
96 96
 }
Please login to merge, or discard this patch.