Completed
Pull Request — 2.6 (#7785)
by Michele
08:08
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 string|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 string|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/Tools/SchemaTool.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
                             $targetEntity = current(
226 226
                                 array_filter(
227 227
                                     $classes,
228
-                                    function (ClassMetadata $class) use ($idMapping) : bool {
228
+                                    function(ClassMetadata $class) use ($idMapping) : bool {
229 229
                                         return $class->name === $idMapping['targetEntity'];
230 230
                                     }
231 231
                                 )
@@ -645,8 +645,8 @@  discard block
 block discarded – undo
645 645
 
646 646
             if ( ! $definingClass) {
647 647
                 throw new \Doctrine\ORM\ORMException(
648
-                    'Column name `' . $joinColumn['referencedColumnName'] . '` referenced for relation from '
649
-                    . $mapping['sourceEntity'] . ' towards ' . $mapping['targetEntity'] . ' does not exist.'
648
+                    'Column name `'.$joinColumn['referencedColumnName'].'` referenced for relation from '
649
+                    . $mapping['sourceEntity'].' towards '.$mapping['targetEntity'].' does not exist.'
650 650
                 );
651 651
             }
652 652
 
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
      */
742 742
     private function gatherColumnOptions(array $mapping) : array
743 743
     {
744
-        if (! isset($mapping['options'])) {
744
+        if ( ! isset($mapping['options'])) {
745 745
             return [];
746 746
         }
747 747
 
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
                 if ($table->hasPrimaryKey()) {
848 848
                     $columns = $table->getPrimaryKey()->getColumns();
849 849
                     if (count($columns) == 1) {
850
-                        $checkSequence = $table->getName() . '_' . $columns[0] . '_seq';
850
+                        $checkSequence = $table->getName().'_'.$columns[0].'_seq';
851 851
                         if ($fullSchema->hasSequence($checkSequence)) {
852 852
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
853 853
                         }
Please login to merge, or discard this patch.
tests/Doctrine/Performance/Query/QueryBoundParameterProcessingBench.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
         $this->parsedQueryWithDeclaredParameterType = $entityManager->createQuery($dql);
58 58
 
59 59
         foreach (range(1, 10) as $index) {
60
-            $this->parsedQueryWithInferredParameterType->setParameter('parameter' . $index, new DateTime());
61
-            $this->parsedQueryWithDeclaredParameterType->setParameter('parameter' . $index, new DateTime(), DateTimeType::DATETIME);
60
+            $this->parsedQueryWithInferredParameterType->setParameter('parameter'.$index, new DateTime());
61
+            $this->parsedQueryWithDeclaredParameterType->setParameter('parameter'.$index, new DateTime(), DateTimeType::DATETIME);
62 62
         }
63 63
 
64 64
         // Force parsing upfront - we don't benchmark that bit in this scenario
Please login to merge, or discard this patch.
tests/Doctrine/Performance/EntityManagerFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
     {
20 20
         $config = new Configuration();
21 21
 
22
-        $config->setProxyDir(__DIR__ . '/../Tests/Proxies');
22
+        $config->setProxyDir(__DIR__.'/../Tests/Proxies');
23 23
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
24 24
         $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL);
25 25
         $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([
26
-            realpath(__DIR__ . '/Models/Cache'),
27
-            realpath(__DIR__ . '/Models/GeoNames'),
26
+            realpath(__DIR__.'/Models/Cache'),
27
+            realpath(__DIR__.'/Models/GeoNames'),
28 28
         ], true));
29 29
 
30 30
         $entityManager = EntityManager::create(
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $config = new Configuration();
47 47
 
48
-        $config->setProxyDir(__DIR__ . '/../Tests/Proxies');
48
+        $config->setProxyDir(__DIR__.'/../Tests/Proxies');
49 49
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
50 50
         $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL);
51 51
         $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([
52
-            realpath(__DIR__ . '/Models/Cache'),
53
-            realpath(__DIR__ . '/Models/Generic'),
54
-            realpath(__DIR__ . '/Models/GeoNames'),
52
+            realpath(__DIR__.'/Models/Cache'),
53
+            realpath(__DIR__.'/Models/Generic'),
54
+            realpath(__DIR__.'/Models/GeoNames'),
55 55
         ], true));
56 56
 
57 57
         // A connection that doesn't really do anything
Please login to merge, or discard this patch.
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;
@@ -477,11 +477,11 @@  discard block
 block discarded – undo
477 477
 
478 478
             $parentClass->mapEmbedded(
479 479
                 [
480
-                    'fieldName' => $prefix . '.' . $property,
480
+                    'fieldName' => $prefix.'.'.$property,
481 481
                     'class' => $embeddableMetadata->name,
482 482
                     'columnPrefix' => $embeddableClass['columnPrefix'],
483 483
                     'declaredField' => $embeddableClass['declaredField']
484
-                            ? $prefix . '.' . $embeddableClass['declaredField']
484
+                            ? $prefix.'.'.$embeddableClass['declaredField']
485 485
                             : $prefix,
486 486
                     'originalField' => $embeddableClass['originalField'] ?: $property,
487 487
                 ]
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
      */
500 500
     private function addInheritedIndexes(ClassMetadata $subClass, ClassMetadata $parentClass)
501 501
     {
502
-        if (! $parentClass->isMappedSuperclass) {
502
+        if ( ! $parentClass->isMappedSuperclass) {
503 503
             return;
504 504
         }
505 505
 
@@ -707,14 +707,14 @@  discard block
 block discarded – undo
707 707
                     throw new ORMException("Can't instantiate custom generator : no custom generator definition");
708 708
                 }
709 709
                 if ( ! class_exists($definition['class'])) {
710
-                    throw new ORMException("Can't instantiate custom generator : " .
710
+                    throw new ORMException("Can't instantiate custom generator : ".
711 711
                         $definition['class']);
712 712
                 }
713 713
                 $class->setIdGenerator(new $definition['class']);
714 714
                 break;
715 715
 
716 716
             default:
717
-                throw new ORMException("Unknown generator type: " . $class->generatorType);
717
+                throw new ORMException("Unknown generator type: ".$class->generatorType);
718 718
         }
719 719
     }
720 720
 
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
      */
765 765
     protected function getFqcnFromAlias($namespaceAlias, $simpleClassName)
766 766
     {
767
-        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
767
+        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName;
768 768
     }
769 769
 
770 770
     /**
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
      */
789 789
     private function getTargetPlatform()
790 790
     {
791
-        if (!$this->targetPlatform) {
791
+        if ( ! $this->targetPlatform) {
792 792
             $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform();
793 793
         }
794 794
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/Parser.php 1 patch
Spacing   +15 added lines, -16 removed lines patch added patch discarded remove patch
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
         if ($token === null) {
472 472
             $token = $this->lexer->lookahead;
473 473
             if ($token === null) {
474
-                $token  = [
474
+                $token = [
475 475
                     'position' => null,
476 476
                 ];
477 477
             }
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
         $tokenStr = substr($dql, $token['position'], $length);
492 492
 
493 493
         // Building informative message
494
-        $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message;
494
+        $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message;
495 495
 
496 496
         throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL()));
497 497
     }
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
             // If the namespace is not given then assumes the first FROM entity namespace
639 639
             if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) {
640 640
                 $namespace  = substr($fromClassName, 0, strrpos($fromClassName, '\\'));
641
-                $fqcn       = $namespace . '\\' . $className;
641
+                $fqcn       = $namespace.'\\'.$className;
642 642
 
643 643
                 if (class_exists($fqcn)) {
644 644
                     $expression->className  = $fqcn;
@@ -690,13 +690,13 @@  discard block
 block discarded – undo
690 690
                 }
691 691
 
692 692
                 $this->semanticalError(
693
-                    "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token']
693
+                    "There is no mapped field named '$field' on class ".$class->name.".", $deferredItem['token']
694 694
                 );
695 695
             }
696 696
 
697 697
             if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) {
698 698
                 $this->semanticalError(
699
-                    "The partial field selection of class " . $class->name . " must contain the identifier.",
699
+                    "The partial field selection of class ".$class->name." must contain the identifier.",
700 700
                     $deferredItem['token']
701 701
                 );
702 702
             }
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
             // Check if field or association exists
766 766
             if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) {
767 767
                 $this->semanticalError(
768
-                    'Class ' . $class->name . ' has no field or association named ' . $field,
768
+                    'Class '.$class->name.' has no field or association named '.$field,
769 769
                     $deferredItem['token']
770 770
                 );
771 771
             }
@@ -805,8 +805,8 @@  discard block
 block discarded – undo
805 805
                 // Build the error message
806 806
                 $semanticalError  = 'Invalid PathExpression. ';
807 807
                 $semanticalError .= (count($expectedStringTypes) == 1)
808
-                    ? 'Must be a ' . $expectedStringTypes[0] . '.'
809
-                    : implode(' or ', $expectedStringTypes) . ' expected.';
808
+                    ? 'Must be a '.$expectedStringTypes[0].'.'
809
+                    : implode(' or ', $expectedStringTypes).' expected.';
810 810
 
811 811
                 $this->semanticalError($semanticalError, $deferredItem['token']);
812 812
             }
@@ -848,8 +848,7 @@  discard block
 block discarded – undo
848 848
         $this->lexer->moveNext();
849 849
 
850 850
         switch ($this->lexer->lookahead === null ? null : $this->lexer->lookahead['type']) {
851
-            case Lexer::T_SELECT:
852
-                $statement = $this->SelectStatement();
851
+            case Lexer::T_SELECT : $statement = $this->SelectStatement();
853 852
                 break;
854 853
 
855 854
             case Lexer::T_UPDATE:
@@ -980,7 +979,7 @@  discard block
 block discarded – undo
980 979
 
981 980
         [$namespaceAlias, $simpleClassName] = explode(':', $this->lexer->token['value']);
982 981
 
983
-        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
982
+        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName;
984 983
     }
985 984
 
986 985
     /**
@@ -992,7 +991,7 @@  discard block
 block discarded – undo
992 991
      */
993 992
     private function validateAbstractSchemaName($schemaName)
994 993
     {
995
-        if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) {
994
+        if ( ! (class_exists($schemaName, true) || interface_exists($schemaName, true))) {
996 995
             $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token);
997 996
         }
998 997
     }
@@ -1048,7 +1047,7 @@  discard block
 block discarded – undo
1048 1047
 
1049 1048
         if ( ! isset($this->queryComponents[$identVariable])) {
1050 1049
             $this->semanticalError(
1051
-                'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.'
1050
+                'Identification Variable '.$identVariable.' used in join path expression but was not defined before.'
1052 1051
             );
1053 1052
         }
1054 1053
 
@@ -1062,7 +1061,7 @@  discard block
 block discarded – undo
1062 1061
         $class = $qComp['metadata'];
1063 1062
 
1064 1063
         if ( ! $class->hasAssociation($field)) {
1065
-            $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field);
1064
+            $this->semanticalError('Class '.$class->name.' has no association named '.$field);
1066 1065
         }
1067 1066
 
1068 1067
         return new AST\JoinAssociationPathExpression($identVariable, $field);
@@ -2485,7 +2484,7 @@  discard block
 block discarded – undo
2485 2484
         $peek = $this->peekBeyondClosingParenthesis();
2486 2485
 
2487 2486
         if ($peek !== null) {
2488
-            if (in_array($peek['value'], ["=",  "<", "<=", "<>", ">", ">=", "!="]) ||
2487
+            if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) ||
2489 2488
                 in_array($peek['type'], [Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS]) ||
2490 2489
                 $this->isMathOperator($peek)) {
2491 2490
                 $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression();
@@ -2591,7 +2590,7 @@  discard block
 block discarded – undo
2591 2590
             return $this->NullComparisonExpression();
2592 2591
         }
2593 2592
 
2594
-        if ($token['type'] === Lexer::T_IS  && $lookahead['type'] === Lexer::T_EMPTY) {
2593
+        if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) {
2595 2594
             return $this->EmptyCollectionComparisonExpression();
2596 2595
         }
2597 2596
 
Please login to merge, or discard this patch.