Failed Conditions
Push — master ( 06ffd8...0b7d87 )
by Marco
13s
created
lib/Doctrine/ORM/AbstractQuery.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     public function getParameter($key)
310 310
     {
311 311
         $filteredParameters = $this->parameters->filter(
312
-            function (Query\Parameter $parameter) use ($key) : bool {
312
+            function(Query\Parameter $parameter) use ($key) : bool {
313 313
                 $parameterName = $parameter->getName();
314 314
 
315 315
                 return $key === $parameterName || (string) $key === (string) $parameterName;
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
             return null;
726 726
         }
727 727
 
728
-        if (! is_array($result)) {
728
+        if ( ! is_array($result)) {
729 729
             return $result;
730 730
         }
731 731
 
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
             throw new NoResultException();
760 760
         }
761 761
 
762
-        if (! is_array($result)) {
762
+        if ( ! is_array($result)) {
763 763
             return $result;
764 764
         }
765 765
 
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
             $this->setHydrationMode($hydrationMode);
850 850
         }
851 851
 
852
-        if (! empty($parameters)) {
852
+        if ( ! empty($parameters)) {
853 853
             $this->setParameters($parameters);
854 854
         }
855 855
 
@@ -890,11 +890,11 @@  discard block
 block discarded – undo
890 890
             $this->setHydrationMode($hydrationMode);
891 891
         }
892 892
 
893
-        if (! empty($parameters)) {
893
+        if ( ! empty($parameters)) {
894 894
             $this->setParameters($parameters);
895 895
         }
896 896
 
897
-        $setCacheEntry = function () {
897
+        $setCacheEntry = function() {
898 898
         };
899 899
 
900 900
         if ($this->hydrationCacheProfile !== null) {
@@ -908,11 +908,11 @@  discard block
 block discarded – undo
908 908
                 return $result[$realCacheKey];
909 909
             }
910 910
 
911
-            if (! $result) {
911
+            if ( ! $result) {
912 912
                 $result = [];
913 913
             }
914 914
 
915
-            $setCacheEntry = function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) {
915
+            $setCacheEntry = function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) {
916 916
                 $result[$realCacheKey] = $data;
917 917
 
918 918
                 $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime());
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
     {
1075 1075
         $query  = $this->getSQL();
1076 1076
         $hints  = $this->getHints();
1077
-        $params = array_map(function (Parameter $parameter) {
1077
+        $params = array_map(function(Parameter $parameter) {
1078 1078
             $value = $parameter->getValue();
1079 1079
 
1080 1080
             // Small optimization
@@ -1088,6 +1088,6 @@  discard block
 block discarded – undo
1088 1088
 
1089 1089
         ksort($hints);
1090 1090
 
1091
-        return sha1($query . '-' . serialize($params) . '-' . serialize($hints));
1091
+        return sha1($query.'-'.serialize($params).'-'.serialize($hints));
1092 1092
     }
1093 1093
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/AttachEntityListenersListener.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Tools;
6 6
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         /** @var ClassMetadata $metadata */
45 45
         $metadata = $event->getClassMetadata();
46 46
 
47
-        if (! isset($this->entityListeners[$metadata->getClassName()])) {
47
+        if ( ! isset($this->entityListeners[$metadata->getClassName()])) {
48 48
             return;
49 49
         }
50 50
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Tools;
6 6
 
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
                     $pkColumns = [];
181 181
 
182 182
                     foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
183
-                        if (! ($property instanceof FieldMetadata)) {
183
+                        if ( ! ($property instanceof FieldMetadata)) {
184 184
                             continue;
185 185
                         }
186 186
 
187
-                        if (! $class->isInheritedProperty($fieldName)) {
187
+                        if ( ! $class->isInheritedProperty($fieldName)) {
188 188
                             $columnName = $this->platform->quoteIdentifier($property->getColumnName());
189 189
 
190 190
                             $this->gatherColumn($class, $property, $table);
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                             }
220 220
                         }
221 221
 
222
-                        if (! empty($inheritedKeyColumns)) {
222
+                        if ( ! empty($inheritedKeyColumns)) {
223 223
                             // Add a FK constraint on the ID column
224 224
                             $rootClass = $this->em->getClassMetadata($class->getRootClassName());
225 225
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                 }
265 265
             }
266 266
 
267
-            if (! $table->hasIndex('primary')) {
267
+            if ( ! $table->hasIndex('primary')) {
268 268
                 $table->setPrimaryKey($pkColumns);
269 269
             }
270 270
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             $processedClasses[$class->getClassName()] = true;
325 325
 
326 326
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
327
-                if (! $property instanceof FieldMetadata
327
+                if ( ! $property instanceof FieldMetadata
328 328
                     || ! $property->hasValueGenerator()
329 329
                     || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE
330 330
                     || $class->getClassName() !== $class->getRootClassName()) {
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
                 $quotedName = $this->platform->quoteIdentifier($property->getValueGenerator()->getDefinition()['sequenceName']);
335 335
 
336
-                if (! $schema->hasSequence($quotedName)) {
336
+                if ( ! $schema->hasSequence($quotedName)) {
337 337
                     $schema->createSequence($quotedName, $property->getValueGenerator()->getDefinition()['allocationSize']);
338 338
                 }
339 339
             }
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             }
347 347
         }
348 348
 
349
-        if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
349
+        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
350 350
             $schema->visit(new RemoveNamespacedAssets());
351 351
         }
352 352
 
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                 break;
386 386
         }
387 387
 
388
-        if (! empty($discrColumn->getColumnDefinition())) {
388
+        if ( ! empty($discrColumn->getColumnDefinition())) {
389 389
             $options['columnDefinition'] = $discrColumn->getColumnDefinition();
390 390
         }
391 391
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         $pkColumns = [];
404 404
 
405 405
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
406
-            if (! ($property instanceof FieldMetadata)) {
406
+            if ( ! ($property instanceof FieldMetadata)) {
407 407
                 continue;
408 408
             }
409 409
 
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
     private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks)
519 519
     {
520 520
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
521
-            if (! ($property instanceof AssociationMetadata)) {
521
+            if ( ! ($property instanceof AssociationMetadata)) {
522 522
                 continue;
523 523
             }
524 524
 
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
                 continue;
527 527
             }
528 528
 
529
-            if (! $property->isOwningSide()) {
529
+            if ( ! $property->isOwningSide()) {
530 530
                 continue;
531 531
             }
532 532
 
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
         $idColumns        = $class->getIdentifierColumns($this->em);
617 617
         $idColumnNameList = array_keys($idColumns);
618 618
 
619
-        if (! in_array($referencedColumnName, $idColumnNameList, true)) {
619
+        if ( ! in_array($referencedColumnName, $idColumnNameList, true)) {
620 620
             return null;
621 621
         }
622 622
 
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
         foreach ($class->getIdentifierFieldNames() as $fieldName) {
625 625
             $property = $class->getProperty($fieldName);
626 626
 
627
-            if (! ($property instanceof AssociationMetadata)) {
627
+            if ( ! ($property instanceof AssociationMetadata)) {
628 628
                 continue;
629 629
             }
630 630
 
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
                 $joinColumn->getReferencedColumnName()
681 681
             );
682 682
 
683
-            if (! $definingClass) {
683
+            if ( ! $definingClass) {
684 684
                 throw new ORMException(sprintf(
685 685
                     'Column name "%s" referenced for relation from %s towards %s does not exist.',
686 686
                     $joinColumn->getReferencedColumnName(),
@@ -696,14 +696,14 @@  discard block
 block discarded – undo
696 696
             $localColumns[]      = $quotedColumnName;
697 697
             $foreignColumns[]    = $quotedReferencedColumnName;
698 698
 
699
-            if (! $theJoinTable->hasColumn($quotedColumnName)) {
699
+            if ( ! $theJoinTable->hasColumn($quotedColumnName)) {
700 700
                 // Only add the column to the table if it does not exist already.
701 701
                 // It might exist already if the foreign key is mapped into a regular
702 702
                 // property as well.
703 703
                 $property  = $definingClass->getProperty($referencedFieldName);
704 704
                 $columnDef = null;
705 705
 
706
-                if (! empty($joinColumn->getColumnDefinition())) {
706
+                if ( ! empty($joinColumn->getColumnDefinition())) {
707 707
                     $columnDef = $joinColumn->getColumnDefinition();
708 708
                 } elseif ($property->getColumnDefinition()) {
709 709
                     $columnDef = $property->getColumnDefinition();
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
                 $uniqueConstraints[] = ['columns' => [$quotedColumnName]];
738 738
             }
739 739
 
740
-            if (! empty($joinColumn->getOnDelete())) {
740
+            if ( ! empty($joinColumn->getOnDelete())) {
741 741
                 $fkOptions['onDelete'] = $joinColumn->getOnDelete();
742 742
             }
743 743
         }
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
             $theJoinTable->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName);
749 749
         }
750 750
 
751
-        $compositeName = $theJoinTable->getName() . '.' . implode('', $localColumns);
751
+        $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns);
752 752
 
753 753
         if (isset($addedFks[$compositeName])
754 754
             && ($foreignTableName !== $addedFks[$compositeName]['foreignTableName']
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
             }
766 766
 
767 767
             $blacklistedFks[$compositeName] = true;
768
-        } elseif (! isset($blacklistedFks[$compositeName])) {
768
+        } elseif ( ! isset($blacklistedFks[$compositeName])) {
769 769
             $addedFks[$compositeName] = [
770 770
                 'foreignTableName' => $foreignTableName,
771 771
                 'foreignColumns'   => $foreignColumns,
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
         $fullSchema = $sm->createSchema();
848 848
 
849 849
         foreach ($fullSchema->getTables() as $table) {
850
-            if (! $schema->hasTable($table->getName())) {
850
+            if ( ! $schema->hasTable($table->getName())) {
851 851
                 foreach ($table->getForeignKeys() as $foreignKey) {
852 852
                     /* @var $foreignKey \Doctrine\DBAL\Schema\ForeignKeyConstraint */
853 853
                     if ($schema->hasTable($foreignKey->getForeignTableName())) {
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
                 if ($table->hasPrimaryKey()) {
873 873
                     $columns = $table->getPrimaryKey()->getColumns();
874 874
                     if (count($columns) === 1) {
875
-                        $checkSequence = $table->getName() . '_' . $columns[0] . '_seq';
875
+                        $checkSequence = $table->getName().'_'.$columns[0].'_seq';
876 876
                         if ($fullSchema->hasSequence($checkSequence)) {
877 877
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
878 878
                         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Tools\Pagination;
6 6
 
@@ -205,13 +205,13 @@  discard block
 block discarded – undo
205 205
 
206 206
         $innerSql           = $this->getInnerSQL($AST);
207 207
         $sqlIdentifier      = $this->getSQLIdentifier($AST);
208
-        $sqlAliasIdentifier = array_map(function ($info) {
208
+        $sqlAliasIdentifier = array_map(function($info) {
209 209
             return $info['alias'];
210 210
         }, $sqlIdentifier);
211 211
 
212 212
         if ($hasOrderBy) {
213
-            $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlAliasIdentifier);
214
-            $sqlPiece     = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum';
213
+            $orderGroupBy = ' GROUP BY '.implode(', ', $sqlAliasIdentifier);
214
+            $sqlPiece     = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum';
215 215
 
216 216
             $sqlAliasIdentifier[] = $sqlPiece;
217 217
             $sqlIdentifier[]      = [
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql);
225 225
 
226 226
         if ($hasOrderBy) {
227
-            $sql .= $orderGroupBy . $outerOrderBy;
227
+            $sql .= $orderGroupBy.$outerOrderBy;
228 228
         }
229 229
 
230 230
         // Apply the limit and offset.
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
         $innerSql           = $this->getInnerSQL($AST);
270 270
         $sqlIdentifier      = $this->getSQLIdentifier($AST);
271
-        $sqlAliasIdentifier = array_map(function ($info) {
271
+        $sqlAliasIdentifier = array_map(function($info) {
272 272
             return $info['alias'];
273 273
         }, $sqlIdentifier);
274 274
 
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
             $idVar = $pathExpression->identificationVariable;
327 327
             $field = $pathExpression->field;
328 328
 
329
-            if (! isset($selects[$idVar])) {
329
+            if ( ! isset($selects[$idVar])) {
330 330
                 $selects[$idVar] = [];
331 331
             }
332 332
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             if ($selectExpression instanceof SelectExpression) {
340 340
                 $idVar = $selectExpression->expression;
341 341
 
342
-                if (! is_string($idVar)) {
342
+                if ( ! is_string($idVar)) {
343 343
                     continue;
344 344
                 }
345 345
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
         ?OrderByClause $orderByClause
375 375
     ) : string {
376 376
         // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement
377
-        if (! $orderByClause) {
377
+        if ( ! $orderByClause) {
378 378
             return $sql;
379 379
         }
380 380
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
             $orderByItems[] = $orderByItemString;
413 413
             $identifier     = substr($orderByItemString, 0, strrpos($orderByItemString, ' '));
414 414
 
415
-            if (! in_array($identifier, $identifiers, true)) {
415
+            if ( ! in_array($identifier, $identifiers, true)) {
416 416
                 $identifiers[] = $identifier;
417 417
             }
418 418
         }
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
      */
566 566
     public function walkPathExpression($pathExpr)
567 567
     {
568
-        if (! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) {
568
+        if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) {
569 569
             $this->orderByPathExpressions[] = $pathExpr;
570 570
         }
571 571
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Utility/NormalizeIdentifier.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Utility;
6 6
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $normalizedAssociatedId = [];
36 36
 
37 37
         foreach ($targetClass->getDeclaredPropertiesIterator() as $name => $declaredProperty) {
38
-            if (! array_key_exists($name, $flatIdentifier)) {
38
+            if ( ! array_key_exists($name, $flatIdentifier)) {
39 39
                 continue;
40 40
             }
41 41
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Proxy/Factory/StaticProxyFactory.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Proxy\Factory;
6 6
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function generateProxyClasses(array $classes) : int
66 66
     {
67
-        $concreteClasses = array_filter($classes, function (ClassMetadata $metadata) : bool {
67
+        $concreteClasses = array_filter($classes, function(ClassMetadata $metadata) : bool {
68 68
             return ! ($metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract());
69 69
         });
70 70
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                 ->proxyFactory
74 74
                 ->createProxy(
75 75
                     $metadata->getClassName(),
76
-                    function () {
76
+                    function() {
77 77
                         // empty closure, serves its purpose, for now
78 78
                     },
79 79
                     $this->skippedFieldsFqns($metadata)
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                 ->getUnitOfWork()
98 98
                 ->getEntityPersister($metadata->getClassName());
99 99
 
100
-        $proxyInstance                                            = $this
100
+        $proxyInstance = $this
101 101
             ->proxyFactory
102 102
             ->createProxy(
103 103
                 $metadata->getClassName(),
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
     private function makeInitializer(ClassMetadata $metadata, EntityPersister $persister) : \Closure
118 118
     {
119
-        return function (
119
+        return function(
120 120
             GhostObjectInterface $ghostObject,
121 121
             string $method,
122 122
             // we don't care
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             $identifier = $persister->getIdentifier($ghostObject);
135 135
 
136 136
             // @TODO how do we use `$properties` in the persister? That would be a massive optimisation
137
-            if (! $persister->loadById($identifier, $ghostObject)) {
137
+            if ( ! $persister->loadById($identifier, $ghostObject)) {
138 138
                 $initializer = $originalInitializer;
139 139
 
140 140
                 throw EntityNotFoundException::fromClassNameAndIdentifier(
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $transientFieldsFqns = [];
167 167
 
168 168
         foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) {
169
-            if (! $property instanceof TransientMetadata) {
169
+            if ( ! $property instanceof TransientMetadata) {
170 170
                 continue;
171 171
             }
172 172
 
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
     private function propertyFqcn(\ReflectionProperty $property) : string
205 205
     {
206 206
         if ($property->isPrivate()) {
207
-            return "\0" . $property->getDeclaringClass()->getName() . "\0" . $property->getName();
207
+            return "\0".$property->getDeclaringClass()->getName()."\0".$property->getName();
208 208
         }
209 209
 
210 210
         if ($property->isProtected()) {
211
-            return "\0*\0" . $property->getName();
211
+            return "\0*\0".$property->getName();
212 212
         }
213 213
 
214 214
         return $property->getName();
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/Parser.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Query;
6 6
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         }
404 404
 
405 405
         foreach ($this->queryComponents as $dqlAlias => $qComp) {
406
-            if (! isset($this->identVariableExpressions[$dqlAlias])) {
406
+            if ( ! isset($this->identVariableExpressions[$dqlAlias])) {
407 407
                 continue;
408 408
             }
409 409
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
         $tokenStr = substr($dql, (int) $token['position'], $length);
468 468
 
469 469
         // Building informative message
470
-        $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message;
470
+        $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message;
471 471
 
472 472
         throw QueryException::semanticalError(
473 473
             $message,
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
             $identVariable = $deferredItem['expression'];
571 571
 
572 572
             // Check if IdentificationVariable exists in queryComponents
573
-            if (! isset($this->queryComponents[$identVariable])) {
573
+            if ( ! isset($this->queryComponents[$identVariable])) {
574 574
                 $this->semanticalError(
575 575
                     sprintf("'%s' is not defined.", $identVariable),
576 576
                     $deferredItem['token']
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
             $qComp = $this->queryComponents[$identVariable];
581 581
 
582 582
             // Check if queryComponent points to an AbstractSchemaName or a ResultVariable
583
-            if (! isset($qComp['metadata'])) {
583
+            if ( ! isset($qComp['metadata'])) {
584 584
                 $this->semanticalError(
585 585
                     sprintf("'%s' does not point to a Class.", $identVariable),
586 586
                     $deferredItem['token']
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
             // If the namespace is not given then assumes the first FROM entity namespace
615 615
             if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) {
616 616
                 $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\'));
617
-                $fqcn      = $namespace . '\\' . $className;
617
+                $fqcn      = $namespace.'\\'.$className;
618 618
 
619 619
                 if (class_exists($fqcn)) {
620 620
                     $expression->className = $fqcn;
@@ -622,13 +622,13 @@  discard block
 block discarded – undo
622 622
                 }
623 623
             }
624 624
 
625
-            if (! class_exists($className)) {
625
+            if ( ! class_exists($className)) {
626 626
                 $this->semanticalError(sprintf('Class "%s" is not defined.', $className), $token);
627 627
             }
628 628
 
629 629
             $class = new \ReflectionClass($className);
630 630
 
631
-            if (! $class->isInstantiable()) {
631
+            if ( ! $class->isInstantiable()) {
632 632
                 $this->semanticalError(sprintf('Class "%s" can not be instantiated.', $className), $token);
633 633
             }
634 634
 
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
             $resultVariable = $deferredItem['expression'];
686 686
 
687 687
             // Check if ResultVariable exists in queryComponents
688
-            if (! isset($this->queryComponents[$resultVariable])) {
688
+            if ( ! isset($this->queryComponents[$resultVariable])) {
689 689
                 $this->semanticalError(
690 690
                     sprintf("'%s' is not defined.", $resultVariable),
691 691
                     $deferredItem['token']
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
             $qComp = $this->queryComponents[$resultVariable];
696 696
 
697 697
             // Check if queryComponent points to an AbstractSchemaName or a ResultVariable
698
-            if (! isset($qComp['resultVariable'])) {
698
+            if ( ! isset($qComp['resultVariable'])) {
699 699
                 $this->semanticalError(
700 700
                     sprintf("'%s' does not point to a ResultVariable.", $resultVariable),
701 701
                     $deferredItem['token']
@@ -737,9 +737,9 @@  discard block
 block discarded – undo
737 737
             $property = $class->getProperty($field);
738 738
 
739 739
             // Check if field or association exists
740
-            if (! $property) {
740
+            if ( ! $property) {
741 741
                 $this->semanticalError(
742
-                    'Class ' . $class->getClassName() . ' has no field or association named ' . $field,
742
+                    'Class '.$class->getClassName().' has no field or association named '.$field,
743 743
                     $deferredItem['token']
744 744
                 );
745 745
             }
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
             // Validate if PathExpression is one of the expected types
757 757
             $expectedType = $pathExpression->expectedType;
758 758
 
759
-            if (! ($expectedType & $fieldType)) {
759
+            if ( ! ($expectedType & $fieldType)) {
760 760
                 // We need to recognize which was expected type(s)
761 761
                 $expectedStringTypes = [];
762 762
 
@@ -778,8 +778,8 @@  discard block
 block discarded – undo
778 778
                 // Build the error message
779 779
                 $semanticalError  = 'Invalid PathExpression. ';
780 780
                 $semanticalError .= count($expectedStringTypes) === 1
781
-                    ? 'Must be a ' . $expectedStringTypes[0] . '.'
782
-                    : implode(' or ', $expectedStringTypes) . ' expected.';
781
+                    ? 'Must be a '.$expectedStringTypes[0].'.'
782
+                    : implode(' or ', $expectedStringTypes).' expected.';
783 783
 
784 784
                 $this->semanticalError($semanticalError, $deferredItem['token']);
785 785
             }
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 
792 792
     private function processRootEntityAliasSelected()
793 793
     {
794
-        if (! $this->identVariableExpressions) {
794
+        if ( ! $this->identVariableExpressions) {
795 795
             return;
796 796
         }
797 797
 
@@ -1019,9 +1019,9 @@  discard block
 block discarded – undo
1019 1019
     {
1020 1020
         $identVariable = $this->IdentificationVariable();
1021 1021
 
1022
-        if (! isset($this->queryComponents[$identVariable])) {
1022
+        if ( ! isset($this->queryComponents[$identVariable])) {
1023 1023
             $this->semanticalError(
1024
-                'Identification Variable ' . $identVariable . ' used in join path expression but was not defined before.'
1024
+                'Identification Variable '.$identVariable.' used in join path expression but was not defined before.'
1025 1025
             );
1026 1026
         }
1027 1027
 
@@ -1035,8 +1035,8 @@  discard block
 block discarded – undo
1035 1035
         $class    = $qComp['metadata'];
1036 1036
         $property = $class->getProperty($field);
1037 1037
 
1038
-        if (! ($property !== null && $property instanceof AssociationMetadata)) {
1039
-            $this->semanticalError('Class ' . $class->getClassName() . ' has no association named ' . $field);
1038
+        if ( ! ($property !== null && $property instanceof AssociationMetadata)) {
1039
+            $this->semanticalError('Class '.$class->getClassName().' has no association named '.$field);
1040 1040
         }
1041 1041
 
1042 1042
         return new AST\JoinAssociationPathExpression($identVariable, $field);
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
             while ($this->lexer->isNextToken(Lexer::T_DOT)) {
1067 1067
                 $this->match(Lexer::T_DOT);
1068 1068
                 $this->match(Lexer::T_IDENTIFIER);
1069
-                $field .= '.' . $this->lexer->token['value'];
1069
+                $field .= '.'.$this->lexer->token['value'];
1070 1070
             }
1071 1071
         }
1072 1072
 
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
         // Still need to decide between IdentificationVariable or ResultVariable
1449 1449
         $lookaheadValue = $this->lexer->lookahead['value'];
1450 1450
 
1451
-        if (! isset($this->queryComponents[$lookaheadValue])) {
1451
+        if ( ! isset($this->queryComponents[$lookaheadValue])) {
1452 1452
             $this->semanticalError('Cannot group by undefined identification or result variable.');
1453 1453
         }
1454 1454
 
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
         while ($this->lexer->isNextToken(Lexer::T_DOT)) {
1797 1797
             $this->match(Lexer::T_DOT);
1798 1798
             $this->match(Lexer::T_IDENTIFIER);
1799
-            $field .= '.' . $this->lexer->token['value'];
1799
+            $field .= '.'.$this->lexer->token['value'];
1800 1800
         }
1801 1801
 
1802 1802
         $partialFieldSet[] = $field;
@@ -1810,7 +1810,7 @@  discard block
 block discarded – undo
1810 1810
             while ($this->lexer->isNextToken(Lexer::T_DOT)) {
1811 1811
                 $this->match(Lexer::T_DOT);
1812 1812
                 $this->match(Lexer::T_IDENTIFIER);
1813
-                $field .= '.' . $this->lexer->token['value'];
1813
+                $field .= '.'.$this->lexer->token['value'];
1814 1814
             }
1815 1815
 
1816 1816
             $partialFieldSet[] = $field;
@@ -2431,7 +2431,7 @@  discard block
 block discarded – undo
2431 2431
 
2432 2432
         // Phase 1 AST optimization: Prevent AST\ConditionalFactor
2433 2433
         // if only one AST\ConditionalPrimary is defined
2434
-        if (! $not) {
2434
+        if ( ! $not) {
2435 2435
             return $conditionalPrimary;
2436 2436
         }
2437 2437
 
@@ -2450,7 +2450,7 @@  discard block
 block discarded – undo
2450 2450
     {
2451 2451
         $condPrimary = new AST\ConditionalPrimary();
2452 2452
 
2453
-        if (! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) {
2453
+        if ( ! $this->lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) {
2454 2454
             $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression();
2455 2455
 
2456 2456
             return $condPrimary;
@@ -2618,7 +2618,7 @@  discard block
 block discarded – undo
2618 2618
             $this->match(Lexer::T_OF);
2619 2619
         }
2620 2620
 
2621
-        $collMemberExpr      = new AST\CollectionMemberExpression(
2621
+        $collMemberExpr = new AST\CollectionMemberExpression(
2622 2622
             $entityExpr,
2623 2623
             $this->CollectionValuedPathExpression()
2624 2624
         );
@@ -2953,7 +2953,7 @@  discard block
 block discarded – undo
2953 2953
         $lookaheadType = $this->lexer->lookahead['type'];
2954 2954
         $isDistinct    = false;
2955 2955
 
2956
-        if (! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM], true)) {
2956
+        if ( ! in_array($lookaheadType, [Lexer::T_COUNT, Lexer::T_AVG, Lexer::T_MAX, Lexer::T_MIN, Lexer::T_SUM], true)) {
2957 2957
             $this->syntaxError('One of: MAX, MIN, AVG, SUM, COUNT');
2958 2958
         }
2959 2959
 
@@ -2983,7 +2983,7 @@  discard block
 block discarded – undo
2983 2983
         $lookaheadType = $this->lexer->lookahead['type'];
2984 2984
         $value         = $this->lexer->lookahead['value'];
2985 2985
 
2986
-        if (! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME], true)) {
2986
+        if ( ! in_array($lookaheadType, [Lexer::T_ALL, Lexer::T_ANY, Lexer::T_SOME], true)) {
2987 2987
             $this->syntaxError('ALL, ANY or SOME');
2988 2988
         }
2989 2989
 
@@ -3221,7 +3221,7 @@  discard block
 block discarded – undo
3221 3221
                 $lookaheadValue = $this->lexer->lookahead['value'];
3222 3222
 
3223 3223
                 // Validate existing component
3224
-                if (! isset($this->queryComponents[$lookaheadValue])) {
3224
+                if ( ! isset($this->queryComponents[$lookaheadValue])) {
3225 3225
                     $this->semanticalError('Cannot add having condition on undefined result variable.');
3226 3226
                 }
3227 3227
 
@@ -3232,7 +3232,7 @@  discard block
 block discarded – undo
3232 3232
                 }
3233 3233
 
3234 3234
                 // Validating ResultVariable
3235
-                if (! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) {
3235
+                if ( ! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) {
3236 3236
                     $this->semanticalError('Cannot add having condition on a non result variable.');
3237 3237
                 }
3238 3238
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/UnitOfWork.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
         $this->computeChangeSets();
343 343
 
344
-        if (! ($this->entityInsertions ||
344
+        if ( ! ($this->entityInsertions ||
345 345
                 $this->entityDeletions ||
346 346
                 $this->entityUpdates ||
347 347
                 $this->collectionUpdates ||
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
             // Entity deletions come last and need to be in reverse commit order
401 401
             if ($this->entityDeletions) {
402 402
                 foreach (array_reverse($commitOrder) as $committedEntityName) {
403
-                    if (! $this->entityDeletions) {
403
+                    if ( ! $this->entityDeletions) {
404 404
                         break; // just a performance optimisation
405 405
                     }
406 406
 
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
         $oid  = spl_object_id($entity);
484 484
         $data = [];
485 485
 
486
-        if (! isset($this->entityChangeSets[$oid])) {
486
+        if ( ! isset($this->entityChangeSets[$oid])) {
487 487
             return $data;
488 488
         }
489 489
 
@@ -564,12 +564,12 @@  discard block
 block discarded – undo
564 564
                     || ! $class->getProperty($name) instanceof FieldMetadata
565 565
                     || ! $class->getProperty($name)->hasValueGenerator()
566 566
                     || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY
567
-                ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
567
+                ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
568 568
                 $actualData[$name] = $value;
569 569
             }
570 570
         }
571 571
 
572
-        if (! isset($this->originalEntityData[$oid])) {
572
+        if ( ! isset($this->originalEntityData[$oid])) {
573 573
             // Entity is either NEW or MANAGED but not yet fully persisted (only has an id).
574 574
             // These result in an INSERT.
575 575
             $this->originalEntityData[$oid] = $actualData;
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 
597 597
             foreach ($actualData as $propName => $actualValue) {
598 598
                 // skip field, its a partially omitted one!
599
-                if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) {
599
+                if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) {
600 600
                     continue;
601 601
                 }
602 602
 
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
                     if ($owner === null) { // cloned
619 619
                         $actualValue->setOwner($entity, $property);
620 620
                     } elseif ($owner !== $entity) { // no clone, we have to fix
621
-                        if (! $actualValue->isInitialized()) {
621
+                        if ( ! $actualValue->isInitialized()) {
622 622
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
623 623
                         }
624 624
 
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
                         // Check if original value exists
657 657
                         if ($orgValue instanceof PersistentCollection) {
658 658
                             // A PersistentCollection was de-referenced, so delete it.
659
-                            if (! $this->isCollectionScheduledForDeletion($orgValue)) {
659
+                            if ( ! $this->isCollectionScheduledForDeletion($orgValue)) {
660 660
                                 $this->scheduleCollectionDeletion($orgValue);
661 661
 
662 662
                                 $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 
680 680
         // Look for changes in associations of the entity
681 681
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
682
-            if (! $property instanceof AssociationMetadata) {
682
+            if ( ! $property instanceof AssociationMetadata) {
683 683
                 continue;
684 684
             }
685 685
 
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
                 // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here.
747 747
                 $oid = spl_object_id($entity);
748 748
 
749
-                if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) {
749
+                if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) {
750 750
                     $this->computeChangeSet($class, $entity);
751 751
                 }
752 752
             }
@@ -783,13 +783,13 @@  discard block
 block discarded – undo
783 783
         $targetClass    = $this->em->getClassMetadata($targetEntity);
784 784
 
785 785
         foreach ($unwrappedValue as $key => $entry) {
786
-            if (! ($entry instanceof $targetEntity)) {
786
+            if ( ! ($entry instanceof $targetEntity)) {
787 787
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry);
788 788
             }
789 789
 
790 790
             $state = $this->getEntityState($entry, self::STATE_NEW);
791 791
 
792
-            if (! ($entry instanceof $targetEntity)) {
792
+            if ( ! ($entry instanceof $targetEntity)) {
793 793
                 throw ORMException::unexpectedAssociationValue(
794 794
                     $association->getSourceEntity(),
795 795
                     $association->getName(),
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 
801 801
             switch ($state) {
802 802
                 case self::STATE_NEW:
803
-                    if (! in_array('persist', $association->getCascade(), true)) {
803
+                    if ( ! in_array('persist', $association->getCascade(), true)) {
804 804
                         $this->nonCascadedNewDetectedEntities[spl_object_id($entry)] = [$association, $entry];
805 805
 
806 806
                         break;
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
         $persister      = $this->getEntityPersister($class->getClassName());
850 850
         $generationPlan->executeImmediate($this->em, $entity);
851 851
 
852
-        if (! $generationPlan->containsDeferred()) {
852
+        if ( ! $generationPlan->containsDeferred()) {
853 853
             $id                            = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity));
854 854
             $this->entityIdentifiers[$oid] = $id;
855 855
         }
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
     {
881 881
         $oid = spl_object_id($entity);
882 882
 
883
-        if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
883
+        if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
884 884
             throw ORMInvalidArgumentException::entityNotManaged($entity);
885 885
         }
886 886
 
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
                     break;
903 903
 
904 904
                 case ($property instanceof FieldMetadata):
905
-                    if (! $property->isPrimaryKey()
905
+                    if ( ! $property->isPrimaryKey()
906 906
                         || ! $property->getValueGenerator()
907 907
                         || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) {
908 908
                         $actualData[$name] = $property->getValue($entity);
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
             }
917 917
         }
918 918
 
919
-        if (! isset($this->originalEntityData[$oid])) {
919
+        if ( ! isset($this->originalEntityData[$oid])) {
920 920
             throw new \RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.');
921 921
         }
922 922
 
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
         if ($changeSet) {
935 935
             if (isset($this->entityChangeSets[$oid])) {
936 936
                 $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet);
937
-            } elseif (! isset($this->entityInsertions[$oid])) {
937
+            } elseif ( ! isset($this->entityInsertions[$oid])) {
938 938
                 $this->entityChangeSets[$oid] = $changeSet;
939 939
                 $this->entityUpdates[$oid]    = $entity;
940 940
             }
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
                 $this->recomputeSingleEntityChangeSet($class, $entity);
1005 1005
             }
1006 1006
 
1007
-            if (! empty($this->entityChangeSets[$oid])) {
1007
+            if ( ! empty($this->entityChangeSets[$oid])) {
1008 1008
 //                echo 'Update: ';
1009 1009
 //                \Doctrine\Common\Util\Debug::dump($this->entityChangeSets[$oid], 3);
1010 1010
 
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
             // Entity with this $oid after deletion treated as NEW, even if the $oid
1048 1048
             // is obtained by a new entity because the old one went out of scope.
1049 1049
             //$this->entityStates[$oid] = self::STATE_NEW;
1050
-            if (! $class->isIdentifierComposite()) {
1050
+            if ( ! $class->isIdentifierComposite()) {
1051 1051
                 $property = $class->getProperty($class->getSingleIdentifierFieldName());
1052 1052
 
1053 1053
                 if ($property instanceof FieldMetadata && $property->hasValueGenerator()) {
@@ -1094,13 +1094,13 @@  discard block
 block discarded – undo
1094 1094
         // Calculate dependencies for new nodes
1095 1095
         while ($class = array_pop($newNodes)) {
1096 1096
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
1097
-                if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1097
+                if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1098 1098
                     continue;
1099 1099
                 }
1100 1100
 
1101 1101
                 $targetClass = $this->em->getClassMetadata($property->getTargetEntity());
1102 1102
 
1103
-                if (! $calc->hasNode($targetClass->getClassName())) {
1103
+                if ( ! $calc->hasNode($targetClass->getClassName())) {
1104 1104
                     $calc->addNode($targetClass->getClassName(), $targetClass);
1105 1105
 
1106 1106
                     $newNodes[] = $targetClass;
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
 
1109 1109
                 $weight = ! array_filter(
1110 1110
                     $property->getJoinColumns(),
1111
-                    function (JoinColumnMetadata $joinColumn) {
1111
+                    function(JoinColumnMetadata $joinColumn) {
1112 1112
                         return $joinColumn->isNullable();
1113 1113
                     }
1114 1114
                 );
@@ -1116,14 +1116,14 @@  discard block
 block discarded – undo
1116 1116
                 $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight);
1117 1117
 
1118 1118
                 // If the target class has mapped subclasses, these share the same dependency.
1119
-                if (! $targetClass->getSubClasses()) {
1119
+                if ( ! $targetClass->getSubClasses()) {
1120 1120
                     continue;
1121 1121
                 }
1122 1122
 
1123 1123
                 foreach ($targetClass->getSubClasses() as $subClassName) {
1124 1124
                     $targetSubClass = $this->em->getClassMetadata($subClassName);
1125 1125
 
1126
-                    if (! $calc->hasNode($subClassName)) {
1126
+                    if ( ! $calc->hasNode($subClassName)) {
1127 1127
                         $calc->addNode($targetSubClass->getClassName(), $targetSubClass);
1128 1128
 
1129 1129
                         $newNodes[] = $targetSubClass;
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
     {
1200 1200
         $oid = spl_object_id($entity);
1201 1201
 
1202
-        if (! isset($this->entityIdentifiers[$oid])) {
1202
+        if ( ! isset($this->entityIdentifiers[$oid])) {
1203 1203
             throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update');
1204 1204
         }
1205 1205
 
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
             throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update');
1208 1208
         }
1209 1209
 
1210
-        if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
1210
+        if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
1211 1211
             $this->entityUpdates[$oid] = $entity;
1212 1212
         }
1213 1213
     }
@@ -1283,7 +1283,7 @@  discard block
 block discarded – undo
1283 1283
             return; // entity has not been persisted yet, so nothing more to do.
1284 1284
         }
1285 1285
 
1286
-        if (! $this->isInIdentityMap($entity)) {
1286
+        if ( ! $this->isInIdentityMap($entity)) {
1287 1287
             return;
1288 1288
         }
1289 1289
 
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 
1292 1292
         unset($this->entityUpdates[$oid]);
1293 1293
 
1294
-        if (! isset($this->entityDeletions[$oid])) {
1294
+        if ( ! isset($this->entityDeletions[$oid])) {
1295 1295
             $this->entityDeletions[$oid] = $entity;
1296 1296
             $this->entityStates[$oid]    = self::STATE_REMOVED;
1297 1297
         }
@@ -1393,7 +1393,7 @@  discard block
 block discarded – undo
1393 1393
         $persister = $this->getEntityPersister($class->getClassName());
1394 1394
         $id        = $persister->getIdentifier($entity);
1395 1395
 
1396
-        if (! $id) {
1396
+        if ( ! $id) {
1397 1397
             return self::STATE_NEW;
1398 1398
         }
1399 1399
 
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
         $class = $this->em->getClassMetadata(get_class($entity));
1754 1754
 
1755 1755
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1756
-            if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) {
1756
+            if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) {
1757 1757
                 continue;
1758 1758
             }
1759 1759
 
@@ -1800,7 +1800,7 @@  discard block
 block discarded – undo
1800 1800
         }
1801 1801
 
1802 1802
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1803
-            if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) {
1803
+            if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) {
1804 1804
                 continue;
1805 1805
             }
1806 1806
 
@@ -1816,7 +1816,7 @@  discard block
 block discarded – undo
1816 1816
 
1817 1817
                 case ($relatedEntities instanceof Collection):
1818 1818
                 case (is_array($relatedEntities)):
1819
-                    if (! ($association instanceof ToManyAssociationMetadata)) {
1819
+                    if ( ! ($association instanceof ToManyAssociationMetadata)) {
1820 1820
                         throw ORMInvalidArgumentException::invalidAssociation(
1821 1821
                             $this->em->getClassMetadata($targetEntity),
1822 1822
                             $association,
@@ -1831,7 +1831,7 @@  discard block
 block discarded – undo
1831 1831
                     break;
1832 1832
 
1833 1833
                 case ($relatedEntities !== null):
1834
-                    if (! $relatedEntities instanceof $targetEntity) {
1834
+                    if ( ! $relatedEntities instanceof $targetEntity) {
1835 1835
                         throw ORMInvalidArgumentException::invalidAssociation(
1836 1836
                             $this->em->getClassMetadata($targetEntity),
1837 1837
                             $association,
@@ -1860,7 +1860,7 @@  discard block
 block discarded – undo
1860 1860
         $class             = $this->em->getClassMetadata(get_class($entity));
1861 1861
 
1862 1862
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1863
-            if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) {
1863
+            if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) {
1864 1864
                 continue;
1865 1865
             }
1866 1866
 
@@ -1919,7 +1919,7 @@  discard block
 block discarded – undo
1919 1919
 
1920 1920
         switch (true) {
1921 1921
             case $lockMode === LockMode::OPTIMISTIC:
1922
-                if (! $class->isVersioned()) {
1922
+                if ( ! $class->isVersioned()) {
1923 1923
                     throw OptimisticLockException::notVersioned($class->getClassName());
1924 1924
                 }
1925 1925
 
@@ -1942,7 +1942,7 @@  discard block
 block discarded – undo
1942 1942
             case $lockMode === LockMode::NONE:
1943 1943
             case $lockMode === LockMode::PESSIMISTIC_READ:
1944 1944
             case $lockMode === LockMode::PESSIMISTIC_WRITE:
1945
-                if (! $this->em->getConnection()->isTransactionActive()) {
1945
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
1946 1946
                     throw TransactionRequiredException::transactionRequired();
1947 1947
                 }
1948 1948
 
@@ -2101,7 +2101,7 @@  discard block
 block discarded – undo
2101 2101
                     $entity->addPropertyChangedListener($this);
2102 2102
                 }
2103 2103
             } else {
2104
-                if (! isset($hints[Query::HINT_REFRESH])
2104
+                if ( ! isset($hints[Query::HINT_REFRESH])
2105 2105
                     || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) {
2106 2106
                     return $entity;
2107 2107
                 }
@@ -2149,7 +2149,7 @@  discard block
 block discarded – undo
2149 2149
         }
2150 2150
 
2151 2151
         foreach ($class->getDeclaredPropertiesIterator() as $field => $association) {
2152
-            if (! ($association instanceof AssociationMetadata)) {
2152
+            if ( ! ($association instanceof AssociationMetadata)) {
2153 2153
                 continue;
2154 2154
             }
2155 2155
 
@@ -2198,7 +2198,7 @@  discard block
 block discarded – undo
2198 2198
                 continue;
2199 2199
             }
2200 2200
 
2201
-            if (! $association->isOwningSide()) {
2201
+            if ( ! $association->isOwningSide()) {
2202 2202
                 // use the given entity association
2203 2203
                 if (isset($data[$field]) && is_object($data[$field]) &&
2204 2204
                     isset($this->entityStates[spl_object_id($data[$field])])) {
@@ -2248,7 +2248,7 @@  discard block
 block discarded – undo
2248 2248
                 $associatedId[$targetField] = $joinColumnValue;
2249 2249
             }
2250 2250
 
2251
-            if (! $associatedId) {
2251
+            if ( ! $associatedId) {
2252 2252
                 // Foreign key is NULL
2253 2253
                 $association->setValue($entity, null);
2254 2254
                 $this->originalEntityData[$oid][$field] = null;
@@ -2257,7 +2257,7 @@  discard block
 block discarded – undo
2257 2257
             }
2258 2258
 
2259 2259
             // @todo guilhermeblanco Can we remove the need of this somehow?
2260
-            if (! isset($hints['fetchMode'][$class->getClassName()][$field])) {
2260
+            if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) {
2261 2261
                 $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode();
2262 2262
             }
2263 2263
 
@@ -2274,7 +2274,7 @@  discard block
 block discarded – undo
2274 2274
                     // If this is an uninitialized proxy, we are deferring eager loads,
2275 2275
                     // this association is marked as eager fetch, and its an uninitialized proxy (wtf!)
2276 2276
                     // then we can append this entity for eager loading!
2277
-                    if (! $targetClass->isIdentifierComposite() &&
2277
+                    if ( ! $targetClass->isIdentifierComposite() &&
2278 2278
                         $newValue instanceof GhostObjectInterface &&
2279 2279
                         isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2280 2280
                         $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER &&
@@ -2357,7 +2357,7 @@  discard block
 block discarded – undo
2357 2357
 
2358 2358
     public function triggerEagerLoads()
2359 2359
     {
2360
-        if (! $this->eagerLoadingEntities) {
2360
+        if ( ! $this->eagerLoadingEntities) {
2361 2361
             return;
2362 2362
         }
2363 2363
 
@@ -2366,7 +2366,7 @@  discard block
 block discarded – undo
2366 2366
         $this->eagerLoadingEntities = [];
2367 2367
 
2368 2368
         foreach ($eagerLoadingEntities as $entityName => $ids) {
2369
-            if (! $ids) {
2369
+            if ( ! $ids) {
2370 2370
                 continue;
2371 2371
             }
2372 2372
 
@@ -2664,7 +2664,7 @@  discard block
 block discarded – undo
2664 2664
     {
2665 2665
         $class = $this->em->getClassMetadata(get_class($entity));
2666 2666
 
2667
-        if (! $class->getProperty($propertyName)) {
2667
+        if ( ! $class->getProperty($propertyName)) {
2668 2668
             return; // ignore non-persistent fields
2669 2669
         }
2670 2670
 
@@ -2673,7 +2673,7 @@  discard block
 block discarded – undo
2673 2673
         // Update changeset and mark entity for synchronization
2674 2674
         $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue];
2675 2675
 
2676
-        if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) {
2676
+        if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) {
2677 2677
             $this->scheduleForSynchronization($entity);
2678 2678
         }
2679 2679
     }
@@ -2755,7 +2755,7 @@  discard block
 block discarded – undo
2755 2755
      */
2756 2756
     private static function objToStr($obj)
2757 2757
     {
2758
-        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj);
2758
+        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj);
2759 2759
     }
2760 2760
 
2761 2761
     /**
@@ -2770,7 +2770,7 @@  discard block
 block discarded – undo
2770 2770
      */
2771 2771
     public function markReadOnly($object)
2772 2772
     {
2773
-        if (! is_object($object) || ! $this->isInIdentityMap($object)) {
2773
+        if ( ! is_object($object) || ! $this->isInIdentityMap($object)) {
2774 2774
             throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object);
2775 2775
         }
2776 2776
 
@@ -2788,7 +2788,7 @@  discard block
 block discarded – undo
2788 2788
      */
2789 2789
     public function isReadOnly($object)
2790 2790
     {
2791
-        if (! is_object($object)) {
2791
+        if ( ! is_object($object)) {
2792 2792
             throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object);
2793 2793
         }
2794 2794
 
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
      */
2801 2801
     private function afterTransactionComplete()
2802 2802
     {
2803
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
2803
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
2804 2804
             $persister->afterTransactionComplete();
2805 2805
         });
2806 2806
     }
@@ -2810,7 +2810,7 @@  discard block
 block discarded – undo
2810 2810
      */
2811 2811
     private function afterTransactionRolledBack()
2812 2812
     {
2813
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
2813
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
2814 2814
             $persister->afterTransactionRolledBack();
2815 2815
         });
2816 2816
     }
@@ -2820,7 +2820,7 @@  discard block
 block discarded – undo
2820 2820
      */
2821 2821
     private function performCallbackOnCachedPersister(callable $callback)
2822 2822
     {
2823
-        if (! $this->hasCache) {
2823
+        if ( ! $this->hasCache) {
2824 2824
             return;
2825 2825
         }
2826 2826
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Cache\Persister\Collection;
6 6
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $targetHydrator  = $targetPersister->getEntityHydrator();
165 165
 
166 166
         // Only preserve ordering if association configured it
167
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
167
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
168 168
             // Elements may be an array or a Collection
169 169
             $elements = array_values($elements instanceof Collection ? $elements->getValues() : $elements);
170 170
         }
Please login to merge, or discard this patch.