Failed Conditions
Pull Request — master (#6900)
by
unknown
09:19
created
lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     {
37 37
         $association = $collection->getMapping();
38 38
 
39
-        if (! $association->isOwningSide()) {
39
+        if ( ! $association->isOwningSide()) {
40 40
             return; // ignore inverse side
41 41
         }
42 42
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             /** @var JoinColumnMetadata $joinColumn */
49 49
             $referencedColumnName = $joinColumn->getReferencedColumnName();
50 50
 
51
-            if (! $joinColumn->getType()) {
51
+            if ( ! $joinColumn->getType()) {
52 52
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
53 53
             }
54 54
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $association = $collection->getMapping();
70 70
 
71
-        if (! $association->isOwningSide()) {
71
+        if ( ! $association->isOwningSide()) {
72 72
             return; // ignore inverse side
73 73
         }
74 74
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     {
100 100
         $association = $collection->getMapping();
101 101
 
102
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
102
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
103 103
             throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.');
104 104
         }
105 105
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
147 147
             $referencedColumnName = $joinColumn->getReferencedColumnName();
148 148
 
149
-            if (! $joinColumn->getType()) {
149
+            if ( ! $joinColumn->getType()) {
150 150
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em));
151 151
             }
152 152
 
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
         }*/
179 179
 
180 180
         $sql = 'SELECT COUNT(*)'
181
-            . ' FROM ' . $joinTableName . ' t'
181
+            . ' FROM '.$joinTableName.' t'
182 182
             . $joinTargetEntitySQL
183
-            . ' WHERE ' . implode(' AND ', $conditions);
183
+            . ' WHERE '.implode(' AND ', $conditions);
184 184
 
185 185
         return $this->conn->fetchColumn($sql, $params, 0, $types);
186 186
     }
@@ -202,13 +202,13 @@  discard block
 block discarded – undo
202 202
     {
203 203
         $association = $collection->getMapping();
204 204
 
205
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
205
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
206 206
             throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.');
207 207
         }
208 208
 
209 209
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true);
210 210
 
211
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
211
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
212 212
 
213 213
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
214 214
     }
@@ -218,13 +218,13 @@  discard block
 block discarded – undo
218 218
      */
219 219
     public function contains(PersistentCollection $collection, $element)
220 220
     {
221
-        if (! $this->isValidEntityState($element)) {
221
+        if ( ! $this->isValidEntityState($element)) {
222 222
             return false;
223 223
         }
224 224
 
225 225
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true);
226 226
 
227
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
227
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
228 228
 
229 229
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
230 230
     }
@@ -234,13 +234,13 @@  discard block
 block discarded – undo
234 234
      */
235 235
     public function removeElement(PersistentCollection $collection, $element)
236 236
     {
237
-        if (! $this->isValidEntityState($element)) {
237
+        if ( ! $this->isValidEntityState($element)) {
238 238
             return false;
239 239
         }
240 240
 
241 241
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false);
242 242
 
243
-        $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
243
+        $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
244 244
 
245 245
         return (bool) $this->conn->executeUpdate($sql, $params, $types);
246 246
     }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         $onConditions  = $this->getOnConditionSQL($association);
259 259
         $whereClauses  = $params = $types = [];
260 260
 
261
-        if (! $association->isOwningSide()) {
261
+        if ( ! $association->isOwningSide()) {
262 262
             $association = $targetClass->getProperty($association->getMappedBy());
263 263
             $joinColumns = $association->getJoinTable()->getInverseJoinColumns();
264 264
         } else {
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
271 271
             $referencedColumnName = $joinColumn->getReferencedColumnName();
272 272
 
273
-            if (! $joinColumn->getType()) {
273
+            if ( ! $joinColumn->getType()) {
274 274
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $ownerMetadata, $this->em));
275 275
             }
276 276
 
@@ -298,11 +298,11 @@  discard block
 block discarded – undo
298 298
 
299 299
         $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te');
300 300
 
301
-        $sql = 'SELECT ' . $resultSetMapping->generateSelectClause()
302
-            . ' FROM ' . $tableName . ' te'
303
-            . ' JOIN ' . $joinTableName . ' t ON'
301
+        $sql = 'SELECT '.$resultSetMapping->generateSelectClause()
302
+            . ' FROM '.$tableName.' te'
303
+            . ' JOIN '.$joinTableName.' t ON'
304 304
             . implode(' AND ', $onConditions)
305
-            . ' WHERE ' . implode(' AND ', $whereClauses);
305
+            . ' WHERE '.implode(' AND ', $whereClauses);
306 306
 
307 307
         $sql .= $this->getOrderingSql($criteria, $targetClass);
308 308
         $sql .= $this->getLimitSql($criteria);
@@ -337,8 +337,8 @@  discard block
 block discarded – undo
337 337
 
338 338
         // A join is needed if there is filtering on the target entity
339 339
         $tableName = $rootClass->table->getQuotedQualifiedName($this->platform);
340
-        $joinSql   = ' JOIN ' . $tableName . ' te'
341
-            . ' ON' . implode(' AND ', $this->getOnConditionSQL($association));
340
+        $joinSql   = ' JOIN '.$tableName.' te'
341
+            . ' ON'.implode(' AND ', $this->getOnConditionSQL($association));
342 342
 
343 343
         return [$joinSql, $filterSql];
344 344
     }
@@ -359,18 +359,18 @@  discard block
 block discarded – undo
359 359
             $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias);
360 360
 
361 361
             if ($filterExpr) {
362
-                $filterClauses[] = '(' . $filterExpr . ')';
362
+                $filterClauses[] = '('.$filterExpr.')';
363 363
             }
364 364
         }
365 365
 
366
-        if (! $filterClauses) {
366
+        if ( ! $filterClauses) {
367 367
             return '';
368 368
         }
369 369
 
370 370
         $filterSql = implode(' AND ', $filterClauses);
371 371
 
372 372
         return isset($filterClauses[1])
373
-            ? '(' . $filterSql . ')'
373
+            ? '('.$filterSql.')'
374 374
             : $filterSql
375 375
         ;
376 376
     }
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
             $quotedColumnName           = $this->platform->quoteIdentifier($joinColumn->getColumnName());
400 400
             $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName());
401 401
 
402
-            $conditions[] = ' t.' . $quotedColumnName . ' = te.' . $quotedReferencedColumnName;
402
+            $conditions[] = ' t.'.$quotedColumnName.' = te.'.$quotedReferencedColumnName;
403 403
         }
404 404
 
405 405
         return $conditions;
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
             $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName());
422 422
         }
423 423
 
424
-        return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
424
+        return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?';
425 425
     }
426 426
 
427 427
     /**
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
477 477
             $referencedColumnName = $joinColumn->getReferencedColumnName();
478 478
 
479
-            if (! $joinColumn->getType()) {
479
+            if ( ! $joinColumn->getType()) {
480 480
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
481 481
             }
482 482
 
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
490 490
             $referencedColumnName = $joinColumn->getReferencedColumnName();
491 491
 
492
-            if (! $joinColumn->getType()) {
492
+            if ( ! $joinColumn->getType()) {
493 493
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
494 494
             }
495 495
 
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
541 541
             $referencedColumnName = $joinColumn->getReferencedColumnName();
542 542
 
543
-            if (! $joinColumn->getType()) {
543
+            if ( ! $joinColumn->getType()) {
544 544
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
545 545
             }
546 546
 
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
554 554
             $referencedColumnName = $joinColumn->getReferencedColumnName();
555 555
 
556
-            if (! $joinColumn->getType()) {
556
+            if ( ! $joinColumn->getType()) {
557 557
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
558 558
             }
559 559
 
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
         $sourceClass       = $this->em->getClassMetadata($owningAssociation->getSourceEntity());
638 638
         $targetClass       = $this->em->getClassMetadata($owningAssociation->getTargetEntity());
639 639
 
640
-        if (! $owningAssociation->isOwningSide()) {
640
+        if ( ! $owningAssociation->isOwningSide()) {
641 641
             $owningAssociation  = $targetClass->getProperty($owningAssociation->getMappedBy());
642 642
             $joinTable          = $owningAssociation->getJoinTable();
643 643
             $joinColumns        = $joinTable->getJoinColumns();
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
         }
650 650
 
651 651
         $joinTableName   = $joinTable->getQuotedQualifiedName($this->platform);
652
-        $quotedJoinTable = $joinTableName . ' t';
652
+        $quotedJoinTable = $joinTableName.' t';
653 653
         $whereClauses    = [];
654 654
         $params          = [];
655 655
         $types           = [];
@@ -663,11 +663,11 @@  discard block
 block discarded – undo
663 663
                 $quotedColumnName           = $this->platform->quoteIdentifier($joinColumn->getColumnName());
664 664
                 $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName());
665 665
 
666
-                $joinConditions[] = ' t.' . $quotedColumnName . ' = tr.' . $quotedReferencedColumnName;
666
+                $joinConditions[] = ' t.'.$quotedColumnName.' = tr.'.$quotedReferencedColumnName;
667 667
             }
668 668
 
669 669
             $tableName        = $targetClass->table->getQuotedQualifiedName($this->platform);
670
-            $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions);
670
+            $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions);
671 671
             $indexByProperty  = $targetClass->getProperty($indexBy);
672 672
 
673 673
             switch (true) {
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
691 691
             $referencedColumnName = $joinColumn->getReferencedColumnName();
692 692
 
693
-            if (! $joinColumn->getType()) {
693
+            if ( ! $joinColumn->getType()) {
694 694
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em));
695 695
             }
696 696
 
@@ -699,13 +699,13 @@  discard block
 block discarded – undo
699 699
             $types[]        = $joinColumn->getType();
700 700
         }
701 701
 
702
-        if (! $joinNeeded) {
702
+        if ( ! $joinNeeded) {
703 703
             foreach ($joinColumns as $joinColumn) {
704 704
                 /** @var JoinColumnMetadata $joinColumn */
705 705
                 $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
706 706
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
707 707
 
708
-                if (! $joinColumn->getType()) {
708
+                if ( ! $joinColumn->getType()) {
709 709
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
710 710
                 }
711 711
 
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association);
720 720
 
721 721
             if ($filterSql) {
722
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
722
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
723 723
                 $whereClauses[]   = $filterSql;
724 724
             }
725 725
         }
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
         $association       = $collection->getMapping();
743 743
         $owningAssociation = $association;
744 744
 
745
-        if (! $association->isOwningSide()) {
745
+        if ( ! $association->isOwningSide()) {
746 746
             $sourceClass      = $this->em->getClassMetadata($association->getTargetEntity());
747 747
             $targetClass      = $this->em->getClassMetadata($association->getSourceEntity());
748 748
             $sourceIdentifier = $this->uow->getEntityIdentifier($element);
@@ -768,11 +768,11 @@  discard block
 block discarded – undo
768 768
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
769 769
             $referencedColumnName = $joinColumn->getReferencedColumnName();
770 770
 
771
-            if (! $joinColumn->getType()) {
771
+            if ( ! $joinColumn->getType()) {
772 772
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em));
773 773
             }
774 774
 
775
-            $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?';
775
+            $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?';
776 776
             $params[]       = $sourceIdentifier[$sourceClass->fieldNames[$referencedColumnName]];
777 777
             $types[]        = $joinColumn->getType();
778 778
         }
@@ -782,11 +782,11 @@  discard block
 block discarded – undo
782 782
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
783 783
             $referencedColumnName = $joinColumn->getReferencedColumnName();
784 784
 
785
-            if (! $joinColumn->getType()) {
785
+            if ( ! $joinColumn->getType()) {
786 786
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
787 787
             }
788 788
 
789
-            $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?';
789
+            $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?';
790 790
             $params[]       = $targetIdentifier[$targetClass->fieldNames[$referencedColumnName]];
791 791
             $types[]        = $joinColumn->getType();
792 792
         }
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association);
798 798
 
799 799
             if ($filterSql) {
800
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
800
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
801 801
                 $whereClauses[]   = $filterSql;
802 802
             }
803 803
         }
@@ -842,10 +842,10 @@  discard block
 block discarded – undo
842 842
                 $property   = $targetClass->getProperty($name);
843 843
                 $columnName = $this->platform->quoteIdentifier($property->getColumnName());
844 844
 
845
-                $orderBy[] = $columnName . ' ' . $direction;
845
+                $orderBy[] = $columnName.' '.$direction;
846 846
             }
847 847
 
848
-            return ' ORDER BY ' . implode(', ', $orderBy);
848
+            return ' ORDER BY '.implode(', ', $orderBy);
849 849
         }
850 850
         return '';
851 851
     }
Please login to merge, or discard this patch.
Performance/Hydration/MixedQueryFetchJoinArrayHydrationPerformanceBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
                 'u__status'      => 'developer',
64 64
                 'u__username'    => 'jwage',
65 65
                 'u__name'        => 'Jonathan',
66
-                'sclr0'          => 'JWAGE' . $i,
66
+                'sclr0'          => 'JWAGE'.$i,
67 67
                 'p__phonenumber' => '91',
68 68
             ];
69 69
         }
Please login to merge, or discard this patch.
ORM/Cache/Persister/Collection/ReadWriteCachedCollectionPersister.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         $isInitialized = $collection->isInitialized();
62 62
         $isDirty       = $collection->isDirty();
63 63
 
64
-        if (! $isInitialized && ! $isDirty) {
64
+        if ( ! $isInitialized && ! $isDirty) {
65 65
             return;
66 66
         }
67 67
 
Please login to merge, or discard this patch.