Failed Conditions
Push — master ( 8be1e3...e3936d )
by Marco
14s
created
lib/Doctrine/ORM/Persisters/SqlValueVisitor.php 1 patch
Spacing   +4 added lines, -4 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\Persisters;
6 6
 
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
 
84 84
         switch ($comparison->getOperator()) {
85 85
             case Comparison::CONTAINS:
86
-                return '%' . $value . '%';
86
+                return '%'.$value.'%';
87 87
 
88 88
             case Comparison::STARTS_WITH:
89
-                return $value . '%';
89
+                return $value.'%';
90 90
 
91 91
             case Comparison::ENDS_WITH:
92
-                return '%' . $value;
92
+                return '%'.$value;
93 93
 
94 94
             default:
95 95
                 return $value;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php 1 patch
Spacing   +4 added lines, -4 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\Persisters;
6 6
 
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
 
72 72
         switch ($expr->getType()) {
73 73
             case CompositeExpression::TYPE_AND:
74
-                return '(' . implode(' AND ', $expressionList) . ')';
74
+                return '('.implode(' AND ', $expressionList).')';
75 75
 
76 76
             case CompositeExpression::TYPE_OR:
77
-                return '(' . implode(' OR ', $expressionList) . ')';
77
+                return '('.implode(' OR ', $expressionList).')';
78 78
 
79 79
             default:
80
-                throw new \RuntimeException('Unknown composite ' . $expr->getType());
80
+                throw new \RuntimeException('Unknown composite '.$expr->getType());
81 81
         }
82 82
     }
83 83
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php 1 patch
Spacing   +14 added lines, -14 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\Persisters\Collection;
6 6
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         // the entire collection with a new would trigger this operation.
25 25
         $association = $collection->getMapping();
26 26
 
27
-        if (! $association->isOrphanRemoval()) {
27
+        if ( ! $association->isOrphanRemoval()) {
28 28
             // Handling non-orphan removal should never happen, as @OneToMany
29 29
             // can only be inverse side. For owning side one to many, it is
30 30
             // required to have a join table, which would classify as a ManyToManyPersister.
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $association = $collection->getMapping();
58 58
 
59
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
59
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
60 60
             throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.');
61 61
         }
62 62
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     {
106 106
         $association = $collection->getMapping();
107 107
 
108
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
108
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
109 109
             throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.');
110 110
         }
111 111
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function contains(PersistentCollection $collection, $element)
129 129
     {
130
-        if (! $this->isValidEntityState($element)) {
130
+        if ( ! $this->isValidEntityState($element)) {
131 131
             return false;
132 132
         }
133 133
 
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
     {
152 152
         $association = $collection->getMapping();
153 153
 
154
-        if (! $association->isOrphanRemoval()) {
154
+        if ( ! $association->isOrphanRemoval()) {
155 155
             // no-op: this is not the owning side, therefore no operations should be applied
156 156
             return false;
157 157
         }
158 158
 
159
-        if (! $this->isValidEntityState($element)) {
159
+        if ( ! $this->isValidEntityState($element)) {
160 160
             return false;
161 161
         }
162 162
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         }
195 195
 
196 196
         $tableName = $targetClass->table->getQuotedQualifiedName($this->platform);
197
-        $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
197
+        $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?';
198 198
 
199 199
         return $this->conn->executeUpdate($statement, $parameters);
200 200
     }
@@ -231,17 +231,17 @@  discard block
 block discarded – undo
231 231
             ];
232 232
         }
233 233
 
234
-        $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable
235
-            . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')';
234
+        $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable
235
+            . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')';
236 236
 
237 237
         $this->conn->executeUpdate($statement);
238 238
 
239 239
         // 2) Build insert table records into temporary table
240
-        $dql   = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames())
241
-               . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner';
240
+        $dql   = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames())
241
+               . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner';
242 242
         $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner());
243 243
 
244
-        $statement  = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL();
244
+        $statement  = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL();
245 245
         $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner()));
246 246
         $numDeleted = $this->conn->executeUpdate($statement, $parameters);
247 247
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         // 4) Delete records on each table in the hierarchy
257 257
         $hierarchyClasses = array_merge(
258 258
             array_map(
259
-                function ($className) {
259
+                function($className) {
260 260
                     return $this->em->getClassMetadata($className);
261 261
                 },
262 262
                 array_reverse($targetClass->getSubClasses())
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php 1 patch
Spacing   +47 added lines, -47 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\Persisters\Collection;
6 6
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $association = $collection->getMapping();
30 30
 
31
-        if (! $association->isOwningSide()) {
31
+        if ( ! $association->isOwningSide()) {
32 32
             return; // ignore inverse side
33 33
         }
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             /** @var JoinColumnMetadata $joinColumn */
41 41
             $referencedColumnName = $joinColumn->getReferencedColumnName();
42 42
 
43
-            if (! $joinColumn->getType()) {
43
+            if ( ! $joinColumn->getType()) {
44 44
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
45 45
             }
46 46
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $association = $collection->getMapping();
62 62
 
63
-        if (! $association->isOwningSide()) {
63
+        if ( ! $association->isOwningSide()) {
64 64
             return; // ignore inverse side
65 65
         }
66 66
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     {
92 92
         $association = $collection->getMapping();
93 93
 
94
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
94
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
95 95
             throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.');
96 96
         }
97 97
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
139 139
             $referencedColumnName = $joinColumn->getReferencedColumnName();
140 140
 
141
-            if (! $joinColumn->getType()) {
141
+            if ( ! $joinColumn->getType()) {
142 142
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em));
143 143
             }
144 144
 
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
         }*/
172 172
 
173 173
         $sql = 'SELECT COUNT(*)'
174
-            . ' FROM ' . $joinTableName . ' t'
174
+            . ' FROM '.$joinTableName.' t'
175 175
             . $joinTargetEntitySQL
176
-            . ' WHERE ' . implode(' AND ', $conditions);
176
+            . ' WHERE '.implode(' AND ', $conditions);
177 177
 
178 178
         return $this->conn->fetchColumn($sql, $params, 0, $types);
179 179
     }
@@ -195,13 +195,13 @@  discard block
 block discarded – undo
195 195
     {
196 196
         $association = $collection->getMapping();
197 197
 
198
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
198
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
199 199
             throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.');
200 200
         }
201 201
 
202 202
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true);
203 203
 
204
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
204
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
205 205
 
206 206
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
207 207
     }
@@ -211,13 +211,13 @@  discard block
 block discarded – undo
211 211
      */
212 212
     public function contains(PersistentCollection $collection, $element)
213 213
     {
214
-        if (! $this->isValidEntityState($element)) {
214
+        if ( ! $this->isValidEntityState($element)) {
215 215
             return false;
216 216
         }
217 217
 
218 218
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true);
219 219
 
220
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
220
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
221 221
 
222 222
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
223 223
     }
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
      */
228 228
     public function removeElement(PersistentCollection $collection, $element)
229 229
     {
230
-        if (! $this->isValidEntityState($element)) {
230
+        if ( ! $this->isValidEntityState($element)) {
231 231
             return false;
232 232
         }
233 233
 
234 234
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false);
235 235
 
236
-        $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
236
+        $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
237 237
 
238 238
         return (bool) $this->conn->executeUpdate($sql, $params, $types);
239 239
     }
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $onConditions  = $this->getOnConditionSQL($association);
252 252
         $whereClauses  = $params = $types = [];
253 253
 
254
-        if (! $association->isOwningSide()) {
254
+        if ( ! $association->isOwningSide()) {
255 255
             $association = $targetClass->getProperty($association->getMappedBy());
256 256
             $joinColumns = $association->getJoinTable()->getInverseJoinColumns();
257 257
         } else {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
264 264
             $referencedColumnName = $joinColumn->getReferencedColumnName();
265 265
 
266
-            if (! $joinColumn->getType()) {
266
+            if ( ! $joinColumn->getType()) {
267 267
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $ownerMetadata, $this->em));
268 268
             }
269 269
 
@@ -291,11 +291,11 @@  discard block
 block discarded – undo
291 291
 
292 292
         $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te');
293 293
 
294
-        $sql = 'SELECT ' . $resultSetMapping->generateSelectClause()
295
-            . ' FROM ' . $tableName . ' te'
296
-            . ' JOIN ' . $joinTableName . ' t ON'
294
+        $sql = 'SELECT '.$resultSetMapping->generateSelectClause()
295
+            . ' FROM '.$tableName.' te'
296
+            . ' JOIN '.$joinTableName.' t ON'
297 297
             . implode(' AND ', $onConditions)
298
-            . ' WHERE ' . implode(' AND ', $whereClauses);
298
+            . ' WHERE '.implode(' AND ', $whereClauses);
299 299
 
300 300
         $sql .= $this->getOrderingSql($criteria, $targetClass);
301 301
         $sql .= $this->getLimitSql($criteria);
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
 
331 331
         // A join is needed if there is filtering on the target entity
332 332
         $tableName = $rootClass->table->getQuotedQualifiedName($this->platform);
333
-        $joinSql   = ' JOIN ' . $tableName . ' te'
334
-            . ' ON' . implode(' AND ', $this->getOnConditionSQL($association));
333
+        $joinSql   = ' JOIN '.$tableName.' te'
334
+            . ' ON'.implode(' AND ', $this->getOnConditionSQL($association));
335 335
 
336 336
         return [$joinSql, $filterSql];
337 337
     }
@@ -352,18 +352,18 @@  discard block
 block discarded – undo
352 352
             $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias);
353 353
 
354 354
             if ($filterExpr) {
355
-                $filterClauses[] = '(' . $filterExpr . ')';
355
+                $filterClauses[] = '('.$filterExpr.')';
356 356
             }
357 357
         }
358 358
 
359
-        if (! $filterClauses) {
359
+        if ( ! $filterClauses) {
360 360
             return '';
361 361
         }
362 362
 
363 363
         $filterSql = implode(' AND ', $filterClauses);
364 364
 
365 365
         return isset($filterClauses[1])
366
-            ? '(' . $filterSql . ')'
366
+            ? '('.$filterSql.')'
367 367
             : $filterSql
368 368
         ;
369 369
     }
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
             $quotedColumnName           = $this->platform->quoteIdentifier($joinColumn->getColumnName());
393 393
             $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName());
394 394
 
395
-            $conditions[] = ' t.' . $quotedColumnName . ' = te.' . $quotedReferencedColumnName;
395
+            $conditions[] = ' t.'.$quotedColumnName.' = te.'.$quotedReferencedColumnName;
396 396
         }
397 397
 
398 398
         return $conditions;
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
             $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName());
415 415
         }
416 416
 
417
-        return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
417
+        return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?';
418 418
     }
419 419
 
420 420
     /**
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
469 469
             $referencedColumnName = $joinColumn->getReferencedColumnName();
470 470
 
471
-            if (! $joinColumn->getType()) {
471
+            if ( ! $joinColumn->getType()) {
472 472
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
473 473
             }
474 474
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
482 482
             $referencedColumnName = $joinColumn->getReferencedColumnName();
483 483
 
484
-            if (! $joinColumn->getType()) {
484
+            if ( ! $joinColumn->getType()) {
485 485
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
486 486
             }
487 487
 
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
533 533
             $referencedColumnName = $joinColumn->getReferencedColumnName();
534 534
 
535
-            if (! $joinColumn->getType()) {
535
+            if ( ! $joinColumn->getType()) {
536 536
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
537 537
             }
538 538
 
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
546 546
             $referencedColumnName = $joinColumn->getReferencedColumnName();
547 547
 
548
-            if (! $joinColumn->getType()) {
548
+            if ( ! $joinColumn->getType()) {
549 549
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
550 550
             }
551 551
 
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
         $sourceClass       = $this->em->getClassMetadata($owningAssociation->getSourceEntity());
630 630
         $targetClass       = $this->em->getClassMetadata($owningAssociation->getTargetEntity());
631 631
 
632
-        if (! $owningAssociation->isOwningSide()) {
632
+        if ( ! $owningAssociation->isOwningSide()) {
633 633
             $owningAssociation  = $targetClass->getProperty($owningAssociation->getMappedBy());
634 634
             $joinTable          = $owningAssociation->getJoinTable();
635 635
             $joinColumns        = $joinTable->getJoinColumns();
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
         }
642 642
 
643 643
         $joinTableName   = $joinTable->getQuotedQualifiedName($this->platform);
644
-        $quotedJoinTable = $joinTableName . ' t';
644
+        $quotedJoinTable = $joinTableName.' t';
645 645
         $whereClauses    = [];
646 646
         $params          = [];
647 647
         $types           = [];
@@ -655,11 +655,11 @@  discard block
 block discarded – undo
655 655
                 $quotedColumnName           = $this->platform->quoteIdentifier($joinColumn->getColumnName());
656 656
                 $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName());
657 657
 
658
-                $joinConditions[] = ' t.' . $quotedColumnName . ' = tr.' . $quotedReferencedColumnName;
658
+                $joinConditions[] = ' t.'.$quotedColumnName.' = tr.'.$quotedReferencedColumnName;
659 659
             }
660 660
 
661 661
             $tableName        = $targetClass->table->getQuotedQualifiedName($this->platform);
662
-            $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions);
662
+            $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions);
663 663
             $indexByProperty  = $targetClass->getProperty($indexBy);
664 664
 
665 665
             switch (true) {
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
683 683
             $referencedColumnName = $joinColumn->getReferencedColumnName();
684 684
 
685
-            if (! $joinColumn->getType()) {
685
+            if ( ! $joinColumn->getType()) {
686 686
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em));
687 687
             }
688 688
 
@@ -691,13 +691,13 @@  discard block
 block discarded – undo
691 691
             $types[]        = $joinColumn->getType();
692 692
         }
693 693
 
694
-        if (! $joinNeeded) {
694
+        if ( ! $joinNeeded) {
695 695
             foreach ($joinColumns as $joinColumn) {
696 696
                 /** @var JoinColumnMetadata $joinColumn */
697 697
                 $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
698 698
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
699 699
 
700
-                if (! $joinColumn->getType()) {
700
+                if ( ! $joinColumn->getType()) {
701 701
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
702 702
                 }
703 703
 
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association);
712 712
 
713 713
             if ($filterSql) {
714
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
714
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
715 715
                 $whereClauses[]   = $filterSql;
716 716
             }
717 717
         }
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
         $association       = $collection->getMapping();
735 735
         $owningAssociation = $association;
736 736
 
737
-        if (! $association->isOwningSide()) {
737
+        if ( ! $association->isOwningSide()) {
738 738
             $sourceClass      = $this->em->getClassMetadata($association->getTargetEntity());
739 739
             $targetClass      = $this->em->getClassMetadata($association->getSourceEntity());
740 740
             $sourceIdentifier = $this->uow->getEntityIdentifier($element);
@@ -760,11 +760,11 @@  discard block
 block discarded – undo
760 760
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
761 761
             $referencedColumnName = $joinColumn->getReferencedColumnName();
762 762
 
763
-            if (! $joinColumn->getType()) {
763
+            if ( ! $joinColumn->getType()) {
764 764
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em));
765 765
             }
766 766
 
767
-            $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?';
767
+            $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?';
768 768
             $params[]       = $sourceIdentifier[$sourceClass->fieldNames[$referencedColumnName]];
769 769
             $types[]        = $joinColumn->getType();
770 770
         }
@@ -774,11 +774,11 @@  discard block
 block discarded – undo
774 774
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
775 775
             $referencedColumnName = $joinColumn->getReferencedColumnName();
776 776
 
777
-            if (! $joinColumn->getType()) {
777
+            if ( ! $joinColumn->getType()) {
778 778
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
779 779
             }
780 780
 
781
-            $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?';
781
+            $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?';
782 782
             $params[]       = $targetIdentifier[$targetClass->fieldNames[$referencedColumnName]];
783 783
             $types[]        = $joinColumn->getType();
784 784
         }
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association);
790 790
 
791 791
             if ($filterSql) {
792
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
792
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
793 793
                 $whereClauses[]   = $filterSql;
794 794
             }
795 795
         }
@@ -834,10 +834,10 @@  discard block
 block discarded – undo
834 834
                 $property   = $targetClass->getProperty($name);
835 835
                 $columnName = $this->platform->quoteIdentifier($property->getColumnName());
836 836
 
837
-                $orderBy[] = $columnName . ' ' . $direction;
837
+                $orderBy[] = $columnName.' '.$direction;
838 838
             }
839 839
 
840
-            return ' ORDER BY ' . implode(', ', $orderBy);
840
+            return ' ORDER BY '.implode(', ', $orderBy);
841 841
         }
842 842
         return '';
843 843
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityManager.php 1 patch
Spacing   +17 added lines, -17 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
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     {
274 274
         $query = new Query($this);
275 275
 
276
-        if (! empty($dql)) {
276
+        if ( ! empty($dql)) {
277 277
             $query->setDQL($dql);
278 278
         }
279 279
 
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
         $class     = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
383 383
         $className = $class->getClassName();
384 384
 
385
-        if (! is_array($id)) {
385
+        if ( ! is_array($id)) {
386 386
             if ($class->isIdentifierComposite()) {
387 387
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
388 388
             }
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         $sortedId = [];
404 404
 
405 405
         foreach ($class->identifier as $identifier) {
406
-            if (! isset($id[$identifier])) {
406
+            if ( ! isset($id[$identifier])) {
407 407
                 throw ORMException::missingIdentifierField($className, $identifier);
408 408
             }
409 409
 
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         // Check identity map first
421 421
         $entity = $unitOfWork->tryGetById($sortedId, $class->getRootClassName());
422 422
         if ($entity !== false) {
423
-            if (! ($entity instanceof $className)) {
423
+            if ( ! ($entity instanceof $className)) {
424 424
                 return null;
425 425
             }
426 426
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 
445 445
         switch (true) {
446 446
             case $lockMode === LockMode::OPTIMISTIC:
447
-                if (! $class->isVersioned()) {
447
+                if ( ! $class->isVersioned()) {
448 448
                     throw OptimisticLockException::notVersioned($className);
449 449
                 }
450 450
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 
457 457
             case $lockMode === LockMode::PESSIMISTIC_READ:
458 458
             case $lockMode === LockMode::PESSIMISTIC_WRITE:
459
-                if (! $this->getConnection()->isTransactionActive()) {
459
+                if ( ! $this->getConnection()->isTransactionActive()) {
460 460
                     throw TransactionRequiredException::transactionRequired();
461 461
                 }
462 462
 
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
         $class     = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
476 476
         $className = $class->getClassName();
477 477
 
478
-        if (! is_array($id)) {
478
+        if ( ! is_array($id)) {
479 479
             if ($class->isIdentifierComposite()) {
480 480
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
481 481
             }
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
         $sortedId = [];
501 501
 
502 502
         foreach ($class->identifier as $identifier) {
503
-            if (! isset($scalarId[$identifier])) {
503
+            if ( ! isset($scalarId[$identifier])) {
504 504
                 throw ORMException::missingIdentifierField($className, $identifier);
505 505
             }
506 506
 
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
         $class     = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
542 542
         $className = $class->getClassName();
543 543
 
544
-        if (! is_array($id)) {
544
+        if ( ! is_array($id)) {
545 545
             if ($class->isIdentifierComposite()) {
546 546
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
547 547
             }
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
         $sortedId = [];
563 563
 
564 564
         foreach ($class->identifier as $identifier) {
565
-            if (! isset($id[$identifier])) {
565
+            if ( ! isset($id[$identifier])) {
566 566
                 throw ORMException::missingIdentifierField($className, $identifier);
567 567
             }
568 568
 
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
      */
637 637
     public function persist($entity)
638 638
     {
639
-        if (! is_object($entity)) {
639
+        if ( ! is_object($entity)) {
640 640
             throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity);
641 641
         }
642 642
 
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
      */
660 660
     public function remove($entity)
661 661
     {
662
-        if (! is_object($entity)) {
662
+        if ( ! is_object($entity)) {
663 663
             throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity);
664 664
         }
665 665
 
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
      */
681 681
     public function refresh($entity)
682 682
     {
683
-        if (! is_object($entity)) {
683
+        if ( ! is_object($entity)) {
684 684
             throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity);
685 685
         }
686 686
 
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
      */
837 837
     public static function create($connection, Configuration $config, ?EventManager $eventManager = null)
838 838
     {
839
-        if (! $config->getMetadataDriverImpl()) {
839
+        if ( ! $config->getMetadataDriverImpl()) {
840 840
             throw ORMException::missingMappingDriverImpl();
841 841
         }
842 842
 
@@ -863,12 +863,12 @@  discard block
 block discarded – undo
863 863
             return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager());
864 864
         }
865 865
 
866
-        if (! $connection instanceof Connection) {
866
+        if ( ! $connection instanceof Connection) {
867 867
             throw new \InvalidArgumentException(
868 868
                 sprintf(
869 869
                     'Invalid $connection argument of type %s given%s.',
870 870
                     is_object($connection) ? get_class($connection) : gettype($connection),
871
-                    is_object($connection) ? '' : ': "' . $connection . '"'
871
+                    is_object($connection) ? '' : ': "'.$connection.'"'
872 872
                 )
873 873
             );
874 874
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/PersistentCollection.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
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         //       association (table). Without initializing the collection.
324 324
         $removed = parent::remove($key);
325 325
 
326
-        if (! $removed) {
326
+        if ( ! $removed) {
327 327
             return $removed;
328 328
         }
329 329
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
      */
345 345
     public function removeElement($element)
346 346
     {
347
-        if (! $this->initialized &&
347
+        if ( ! $this->initialized &&
348 348
             $this->association !== null &&
349 349
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) {
350 350
             if ($this->collection->contains($element)) {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
         $removed = parent::removeElement($element);
360 360
 
361
-        if (! $removed) {
361
+        if ( ! $removed) {
362 362
             return $removed;
363 363
         }
364 364
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
      */
380 380
     public function containsKey($key)
381 381
     {
382
-        if (! $this->initialized &&
382
+        if ( ! $this->initialized &&
383 383
             $this->association !== null &&
384 384
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY &&
385 385
             $this->association->getIndexedBy()) {
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
      */
397 397
     public function contains($element)
398 398
     {
399
-        if (! $this->initialized &&
399
+        if ( ! $this->initialized &&
400 400
             $this->association !== null &&
401 401
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) {
402 402
             $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
@@ -412,11 +412,11 @@  discard block
 block discarded – undo
412 412
      */
413 413
     public function get($key)
414 414
     {
415
-        if (! $this->initialized &&
415
+        if ( ! $this->initialized &&
416 416
             $this->association !== null &&
417 417
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY &&
418 418
             $this->association->getIndexedBy()) {
419
-            if (! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) {
419
+            if ( ! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) {
420 420
                 return $this->em->find($this->typeClass->getClassName(), $key);
421 421
             }
422 422
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
      */
432 432
     public function count()
433 433
     {
434
-        if (! $this->initialized &&
434
+        if ( ! $this->initialized &&
435 435
             $this->association !== null &&
436 436
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) {
437 437
             $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
      */
496 496
     public function offsetSet($offset, $value)
497 497
     {
498
-        if (! isset($offset)) {
498
+        if ( ! isset($offset)) {
499 499
             $this->add($value);
500 500
             return;
501 501
         }
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
      */
590 590
     public function slice($offset, $length = null)
591 591
     {
592
-        if (! $this->initialized &&
592
+        if ( ! $this->initialized &&
593 593
             ! $this->isDirty &&
594 594
             $this->association !== null &&
595 595
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityRepository.php 1 patch
Spacing   +4 added lines, -4 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
 
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
      */
285 285
     private function resolveMagicCall($method, $by, array $arguments)
286 286
     {
287
-        if (! $arguments) {
288
-            throw ORMException::findByRequiresParameter($method . $by);
287
+        if ( ! $arguments) {
288
+            throw ORMException::findByRequiresParameter($method.$by);
289 289
         }
290 290
 
291 291
         $fieldName = lcfirst(Inflector::classify($by));
292 292
 
293 293
         if ($this->class->getProperty($fieldName) === null) {
294
-            throw ORMException::invalidMagicCall($this->entityName, $fieldName, $method . $by);
294
+            throw ORMException::invalidMagicCall($this->entityName, $fieldName, $method.$by);
295 295
         }
296 296
 
297 297
         return $this->{$method}([$fieldName => $arguments[0]], ...array_slice($arguments, 1));
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Event/PreUpdateEventArgs.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\Event;
6 6
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     private function assertValidField($field)
103 103
     {
104
-        if (! isset($this->entityChangeSet[$field])) {
104
+        if ( ! isset($this->entityChangeSet[$field])) {
105 105
             throw new \InvalidArgumentException(sprintf(
106 106
                 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.',
107 107
                 $field,
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query.php 1 patch
Spacing   +10 added lines, -10 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
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 
246 246
         // Check query cache.
247 247
         $queryCache = $this->getQueryCacheDriver();
248
-        if (! ($this->useQueryCache && $queryCache)) {
248
+        if ( ! ($this->useQueryCache && $queryCache)) {
249 249
             $parser = new Parser($this);
250 250
 
251 251
             $this->parserResult = $parser->parse();
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
             $value = $parameter->getValue();
383 383
             $rsm   = $this->getResultSetMapping();
384 384
 
385
-            if (! isset($paramMappings[$key])) {
385
+            if ( ! isset($paramMappings[$key])) {
386 386
                 throw QueryException::unknownParameter($key);
387 387
             }
388 388
 
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
     public function setLockMode($lockMode)
691 691
     {
692 692
         if (in_array($lockMode, [LockMode::NONE, LockMode::PESSIMISTIC_READ, LockMode::PESSIMISTIC_WRITE], true)) {
693
-            if (! $this->em->getConnection()->isTransactionActive()) {
693
+            if ( ! $this->em->getConnection()->isTransactionActive()) {
694 694
                 throw TransactionRequiredException::transactionRequired();
695 695
             }
696 696
         }
@@ -731,11 +731,11 @@  discard block
 block discarded – undo
731 731
             ->getName();
732 732
 
733 733
         return md5(
734
-            $this->getDQL() . serialize($this->hints) .
735
-            '&platform=' . $platform .
736
-            ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '') .
737
-            '&firstResult=' . $this->firstResult . '&maxResult=' . $this->maxResults .
738
-            '&hydrationMode=' . $this->hydrationMode . '&types=' . serialize($this->parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT'
734
+            $this->getDQL().serialize($this->hints).
735
+            '&platform='.$platform.
736
+            ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '').
737
+            '&firstResult='.$this->firstResult.'&maxResult='.$this->maxResults.
738
+            '&hydrationMode='.$this->hydrationMode.'&types='.serialize($this->parsedTypes).'DOCTRINE_QUERY_CACHE_SALT'
739 739
         );
740 740
     }
741 741
 
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
      */
745 745
     protected function getHash()
746 746
     {
747
-        return sha1(parent::getHash() . '-' . $this->firstResult . '-' . $this->maxResults);
747
+        return sha1(parent::getHash().'-'.$this->firstResult.'-'.$this->maxResults);
748 748
     }
749 749
 
750 750
     /**
Please login to merge, or discard this patch.