Failed Conditions
Pull Request — 2.6 (#7235)
by Aleksey
10:51
created
tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -232,8 +232,8 @@  discard block
 block discarded – undo
232 232
         $eventManager->addEventListener([Events::postLoad], $listener);
233 233
 
234 234
         $this->_em->find(CmsUser::class, $this->userId);
235
-        $this->assertSame(1, $listener->countHandledEvents(CmsUser::class), CmsUser::class . ' should be handled once!');
236
-        $this->assertSame(1, $listener->countHandledEvents(CmsEmail::class), CmsEmail::class . ' should be handled once!');
235
+        $this->assertSame(1, $listener->countHandledEvents(CmsUser::class), CmsUser::class.' should be handled once!');
236
+        $this->assertSame(1, $listener->countHandledEvents(CmsEmail::class), CmsEmail::class.' should be handled once!');
237 237
     }
238 238
 
239 239
     private function loadFixture()
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     {
310 310
         $object = $event->getObject();
311 311
         $class = ClassUtils::getClass($object);
312
-        if (!isset($this->firedByClasses[$class])) {
312
+        if ( ! isset($this->firedByClasses[$class])) {
313 313
             $this->firedByClasses[$class] = 1;
314 314
         } else {
315 315
             $this->firedByClasses[$class]++;
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,37 +34,37 @@
 block discarded – undo
34 34
         $dql = "SELECT u FROM Doctrine\Tests\Models\Cms\CmsUser u";
35 35
 
36 36
         $users = $this->_em->createQuery($dql)
37
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
38
-                      ->getResult();
37
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
38
+                        ->getResult();
39 39
 
40 40
         $c = $this->getCurrentQueryCount();
41 41
         $users = $this->_em->createQuery($dql)
42
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
43
-                      ->getResult();
42
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
43
+                        ->getResult();
44 44
 
45 45
         $this->assertEquals($c, $this->getCurrentQueryCount(), "Should not execute query. Its cached!");
46 46
 
47 47
         $users = $this->_em->createQuery($dql)
48
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
49
-                      ->getArrayResult();
48
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
49
+                        ->getArrayResult();
50 50
 
51 51
         $this->assertEquals($c + 1, $this->getCurrentQueryCount(), "Hydration is part of cache key.");
52 52
 
53 53
         $users = $this->_em->createQuery($dql)
54
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
55
-                      ->getArrayResult();
54
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
55
+                        ->getArrayResult();
56 56
 
57 57
         $this->assertEquals($c + 1, $this->getCurrentQueryCount(), "Hydration now cached");
58 58
 
59 59
         $users = $this->_em->createQuery($dql)
60
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache))
61
-                      ->getArrayResult();
60
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache))
61
+                        ->getArrayResult();
62 62
 
63 63
         $this->assertTrue($cache->contains('cachekey'), 'Explicit cache key');
64 64
 
65 65
         $users = $this->_em->createQuery($dql)
66
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache))
67
-                      ->getArrayResult();
66
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache))
67
+                        ->getArrayResult();
68 68
         $this->assertEquals($c + 2, $this->getCurrentQueryCount(), "Hydration now cached");
69 69
     }
70 70
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         $this->_em->clear();
51 51
 
52
-        $result2  = $this->_em->createQuery($dql)
52
+        $result2 = $this->_em->createQuery($dql)
53 53
             ->setCacheable(true)
54 54
             ->getResult();
55 55
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 
253 253
         $this->_em->clear();
254 254
 
255
-        $result2  = $this->_em->createQuery($dql)
255
+        $result2 = $this->_em->createQuery($dql)
256 256
             ->setCacheable(true)
257 257
             ->getResult();
258 258
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
         $this->_em->clear();
346 346
 
347
-        $result2  = $this->_em->createQuery($dql)
347
+        $result2 = $this->_em->createQuery($dql)
348 348
             ->setCacheable(true)
349 349
             ->getResult();
350 350
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 
393 393
         $this->_em->clear();
394 394
 
395
-        $result2  = $this->_em->createQuery($dql)->setCacheable(true)
395
+        $result2 = $this->_em->createQuery($dql)->setCacheable(true)
396 396
                 ->setParameter('name', $name)
397 397
                 ->getResult();
398 398
 
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         $result1    = $this->_em->createQuery($dql)->setCacheable(true)->getResult();
421 421
 
422 422
         $this->assertCount(2, $result1);
423
-        $this->assertEquals($queryCount + 1 , $this->getCurrentQueryCount());
423
+        $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount());
424 424
         $this->assertEquals($this->countries[0]->getId(), $result1[0]->getId());
425 425
         $this->assertEquals($this->countries[1]->getId(), $result1[1]->getId());
426 426
         $this->assertEquals($this->countries[0]->getName(), $result1[0]->getName());
@@ -436,11 +436,11 @@  discard block
 block discarded – undo
436 436
 
437 437
         $this->_em->clear();
438 438
 
439
-        $result2  = $this->_em->createQuery($dql)
439
+        $result2 = $this->_em->createQuery($dql)
440 440
             ->setCacheable(true)
441 441
             ->getResult();
442 442
 
443
-        $this->assertEquals($queryCount + 2 , $this->getCurrentQueryCount());
443
+        $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount());
444 444
         $this->assertCount(2, $result2);
445 445
 
446 446
         $this->assertEquals(5, $this->secondLevelCacheLogger->getPutCount());
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
         $this->assertEquals($result1[0]->getName(), $result2[0]->getName());
458 458
         $this->assertEquals($result1[1]->getName(), $result2[1]->getName());
459 459
 
460
-        $this->assertEquals($queryCount + 2 , $this->getCurrentQueryCount());
460
+        $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount());
461 461
     }
462 462
 
463 463
     public function testBasicQueryFetchJoinsOneToMany()
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 
499 499
         $this->_em->clear();
500 500
 
501
-        $result2  = $this->_em->createQuery($dql)
501
+        $result2 = $this->_em->createQuery($dql)
502 502
                 ->setCacheable(true)
503 503
                 ->getResult();
504 504
 
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
         $this->_em->clear();
565 565
         $this->secondLevelCacheLogger->clearStats();
566 566
 
567
-        $result2  = $this->_em->createQuery($dql)
567
+        $result2 = $this->_em->createQuery($dql)
568 568
                 ->setCacheable(true)
569 569
                 ->getResult();
570 570
 
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 
625 625
         $this->cache->evictEntityRegion(State::class);
626 626
 
627
-        $result2  = $this->_em->createQuery($dql)
627
+        $result2 = $this->_em->createQuery($dql)
628 628
                 ->setCacheable(true)
629 629
                 ->getResult();
630 630
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 
668 668
         $this->cache->evictEntityRegion(City::class);
669 669
 
670
-        $result2  = $this->_em->createQuery($dql)
670
+        $result2 = $this->_em->createQuery($dql)
671 671
                 ->setCacheable(true)
672 672
                 ->getResult();
673 673
 
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 
719 719
         $this->_em->clear();
720 720
 
721
-        $result2  = $this->_em->createNativeQuery($sql, $rsm)
721
+        $result2 = $this->_em->createNativeQuery($sql, $rsm)
722 722
             ->setCacheable(true)
723 723
             ->getResult();
724 724
 
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 
774 774
         $this->_em->clear();
775 775
 
776
-        $result2  = $this->_em->createQuery($dql)
776
+        $result2 = $this->_em->createQuery($dql)
777 777
             ->setCacheable(true)
778 778
             ->setFirstResult(2)
779 779
             ->setMaxResults(1)
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 
786 786
         $this->_em->clear();
787 787
 
788
-        $result3  = $this->_em->createQuery($dql)
788
+        $result3 = $this->_em->createQuery($dql)
789 789
             ->setCacheable(true)
790 790
             ->getResult();
791 791
 
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
         $this->secondLevelCacheLogger->clearStats();
803 803
         $this->_em->clear();
804 804
 
805
-        $getHash = function(AbstractQuery $query){
805
+        $getHash = function(AbstractQuery $query) {
806 806
             $method = new \ReflectionMethod($query, 'getHash');
807 807
             $method->setAccessible(true);
808 808
 
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
             ->getRegion()
836 836
             ->put($key, $entry);
837 837
 
838
-        $result2  = $this->_em->createQuery($dql)
838
+        $result2 = $this->_em->createQuery($dql)
839 839
             ->setCacheable(true)
840 840
             ->setLifetime(3600)
841 841
             ->getResult();
Please login to merge, or discard this patch.
Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -160,9 +160,9 @@
 block discarded – undo
160 160
      */
161 161
     private $other2;
162 162
 
163
-    public function getId() {return $this->id;}
164
-    public function setOther1($other1) {$this->other1 = $other1;}
165
-    public function getOther1() {return $this->other1;}
166
-    public function setOther2($other2) {$this->other2 = $other2;}
167
-    public function getOther2() {return $this->other2;}
163
+    public function getId() {return $this->id; }
164
+    public function setOther1($other1) {$this->other1 = $other1; }
165
+    public function getOther1() {return $this->other1; }
166
+    public function setOther2($other2) {$this->other2 = $other2; }
167
+    public function getOther2() {return $this->other2; }
168 168
 }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/CustomFunctionsTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 use Doctrine\Tests\Models\CMS\CmsUser;
12 12
 use Doctrine\Tests\OrmFunctionalTestCase;
13 13
 
14
-require_once __DIR__ . '/../../TestInit.php';
14
+require_once __DIR__.'/../../TestInit.php';
15 15
 
16 16
 class CustomFunctionsTest extends OrmFunctionalTestCase
17 17
 {
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
         try {
74 74
             $this->schemaTool->createSchema($classMetadata);
75
-        } catch(\Exception $e) {
75
+        } catch (\Exception $e) {
76 76
             // was already created
77 77
         }
78 78
 
@@ -87,6 +87,6 @@  discard block
 block discarded – undo
87 87
         $sql = $schemaDiff->toSql($this->_em->getConnection()->getDatabasePlatform());
88 88
         $sql = array_filter($sql, function($sql) { return strpos($sql, 'DROP') === false; });
89 89
 
90
-        $this->assertEquals(0, count($sql), "SQL: " . implode(PHP_EOL, $sql));
90
+        $this->assertEquals(0, count($sql), "SQL: ".implode(PHP_EOL, $sql));
91 91
     }
92 92
 }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
      */
57 57
     public function testDropPartSchemaWithForeignKeys()
58 58
     {
59
-        if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
59
+        if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) {
60 60
             $this->markTestSkipped("Foreign Key test");
61 61
         }
62 62
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
         $updateSql = $this->schemaTool->getUpdateSchemaSql([$class]);
29 29
 
30
-        $updateSql = array_filter($updateSql, function ($sql) {
30
+        $updateSql = array_filter($updateSql, function($sql) {
31 31
             return strpos($sql, 'DBAL483') !== false;
32 32
         });
33 33
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         parent::setUp();
14 14
 
15 15
         if ($this->_em->getConnection()->getDatabasePlatform()->getName() !== 'postgresql') {
16
-            $this->markTestSkipped('The ' . __CLASS__ .' requires the use of postgresql.');
16
+            $this->markTestSkipped('The '.__CLASS__.' requires the use of postgresql.');
17 17
         }
18 18
     }
19 19
 
Please login to merge, or discard this patch.