Completed
Pull Request — master (#7046)
by Gabriel
12:30
created
tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php 1 patch
Spacing   +13 added lines, -13 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\Tests\ORM\Functional;
6 6
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
         $this->em->clear();
50 50
 
51
-        $query = $this->em->createQuery('select p from ' . CompanyPerson::class . ' p order by p.name desc');
51
+        $query = $this->em->createQuery('select p from '.CompanyPerson::class.' p order by p.name desc');
52 52
 
53 53
         $entities = $query->getResult();
54 54
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
         $this->em->clear();
65 65
 
66
-        $query = $this->em->createQuery('select p from ' . CompanyEmployee::class . ' p');
66
+        $query = $this->em->createQuery('select p from '.CompanyEmployee::class.' p');
67 67
 
68 68
         $entities = $query->getResult();
69 69
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         $this->em->clear();
84 84
 
85
-        $query = $this->em->createQuery('update ' . CompanyEmployee::class . " p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
85
+        $query = $this->em->createQuery('update '.CompanyEmployee::class." p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
86 86
 
87 87
         $query->setParameter(1, 'NewName', 'string');
88 88
         $query->setParameter(2, 'NewDepartment');
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         self::assertEquals(1, $numUpdated);
95 95
 
96
-        $query = $this->em->createQuery('delete from ' . CompanyPerson::class . ' p');
96
+        $query = $this->em->createQuery('delete from '.CompanyPerson::class.' p');
97 97
 
98 98
         $numDeleted = $query->execute();
99 99
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $this->em->flush();
169 169
         $this->em->clear();
170 170
 
171
-        $query = $this->em->createQuery('select p, s from ' . CompanyPerson::class . ' p join p.spouse s where p.name=\'Mary Smith\'');
171
+        $query = $this->em->createQuery('select p, s from '.CompanyPerson::class.' p join p.spouse s where p.name=\'Mary Smith\'');
172 172
 
173 173
         $result = $query->getResult();
174 174
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
         $this->em->clear();
202 202
 
203
-        $query = $this->em->createQuery('select p, f from ' . CompanyPerson::class . ' p join p.friends f where p.name=?1');
203
+        $query = $this->em->createQuery('select p, f from '.CompanyPerson::class.' p join p.friends f where p.name=?1');
204 204
 
205 205
         $query->setParameter(1, 'Roman');
206 206
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         $this->em->flush();
267 267
         $this->em->clear();
268 268
 
269
-        $q = $this->em->createQuery('select a from ' . CompanyEvent::class . ' a where a.id = ?1');
269
+        $q = $this->em->createQuery('select a from '.CompanyEvent::class.' a where a.id = ?1');
270 270
 
271 271
         $q->setParameter(1, $event1->getId());
272 272
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 
278 278
         $this->em->clear();
279 279
 
280
-        $q = $this->em->createQuery('select a from ' . CompanyOrganization::class . ' a where a.id = ?1');
280
+        $q = $this->em->createQuery('select a from '.CompanyOrganization::class.' a where a.id = ?1');
281 281
 
282 282
         $q->setParameter(1, $org->getId());
283 283
 
@@ -298,10 +298,10 @@  discard block
 block discarded – undo
298 298
      */
299 299
     public function testBulkUpdateIssueDDC368()
300 300
     {
301
-        $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.salary = 1')
301
+        $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.salary = 1')
302 302
                   ->execute();
303 303
 
304
-        $result = $this->em->createQuery('SELECT count(p.id) FROM ' . CompanyEmployee::class . ' p WHERE p.salary = 1')
304
+        $result = $this->em->createQuery('SELECT count(p.id) FROM '.CompanyEmployee::class.' p WHERE p.salary = 1')
305 305
                             ->getResult();
306 306
 
307 307
         self::assertGreaterThan(0, $result);
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
      */
313 313
     public function testBulkUpdateNonScalarParameterDDC1341()
314 314
     {
315
-        $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.startDate = ?0 WHERE p.department = ?1')
315
+        $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.startDate = ?0 WHERE p.department = ?1')
316 316
                   ->setParameter(0, new \DateTime())
317 317
                   ->setParameter(1, 'IT')
318 318
                   ->execute();
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         $this->em->flush();
371 371
         $this->em->clear();
372 372
 
373
-        $dqlManager = $this->em->createQuery('SELECT m FROM ' . CompanyManager::class . ' m WHERE m.spouse = ?1')
373
+        $dqlManager = $this->em->createQuery('SELECT m FROM '.CompanyManager::class.' m WHERE m.spouse = ?1')
374 374
                                 ->setParameter(1, $person->getId())
375 375
                                 ->getSingleResult();
376 376
 
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
@@ -36,37 +36,37 @@
 block discarded – undo
36 36
         $dql = "SELECT u FROM Doctrine\Tests\Models\Cms\CmsUser u";
37 37
 
38 38
         $users = $this->em->createQuery($dql)
39
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
40
-                      ->getResult();
39
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
40
+                        ->getResult();
41 41
 
42 42
         $c = $this->getCurrentQueryCount();
43 43
         $users = $this->em->createQuery($dql)
44
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
45
-                      ->getResult();
44
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
45
+                        ->getResult();
46 46
 
47 47
         self::assertEquals($c, $this->getCurrentQueryCount(), 'Should not execute query. Its cached!');
48 48
 
49 49
         $users = $this->em->createQuery($dql)
50
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
51
-                      ->getArrayResult();
50
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
51
+                        ->getArrayResult();
52 52
 
53 53
         self::assertEquals($c + 1, $this->getCurrentQueryCount(), 'Hydration is part of cache key.');
54 54
 
55 55
         $users = $this->em->createQuery($dql)
56
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
57
-                      ->getArrayResult();
56
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
57
+                        ->getArrayResult();
58 58
 
59 59
         self::assertEquals($c + 1, $this->getCurrentQueryCount(), 'Hydration now cached');
60 60
 
61 61
         $users = $this->em->createQuery($dql)
62
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache))
63
-                      ->getArrayResult();
62
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache))
63
+                        ->getArrayResult();
64 64
 
65 65
         self::assertTrue($cache->contains('cachekey'), 'Explicit cache key');
66 66
 
67 67
         $users = $this->em->createQuery($dql)
68
-                      ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache))
69
-                      ->getArrayResult();
68
+                        ->setHydrationCacheProfile(new QueryCacheProfile(null, 'cachekey', $cache))
69
+                        ->getArrayResult();
70 70
         self::assertEquals($c + 2, $this->getCurrentQueryCount(), 'Hydration now cached');
71 71
     }
72 72
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php 1 patch
Spacing   +7 added lines, -7 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\Tests\ORM\Functional;
6 6
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $entity = $this->em->find('\Doctrine\Tests\Models\CustomType\CustomTypeUpperCase', $id);
48 48
 
49 49
         self::assertEquals('foo', $entity->lowerCaseString, 'Entity holds lowercase string');
50
-        self::assertEquals('FOO', $this->em->getConnection()->fetchColumn('select lowerCaseString from customtype_uppercases where id=' . $entity->id . ''), 'Database holds uppercase string');
50
+        self::assertEquals('FOO', $this->em->getConnection()->fetchColumn('select lowerCaseString from customtype_uppercases where id='.$entity->id.''), 'Database holds uppercase string');
51 51
     }
52 52
 
53 53
     /**
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 
69 69
         $entity = $this->em->find('\Doctrine\Tests\Models\CustomType\CustomTypeUpperCase', $id);
70 70
         self::assertEquals('foo', $entity->namedLowerCaseString, 'Entity holds lowercase string');
71
-        self::assertEquals('FOO', $this->em->getConnection()->fetchColumn('select named_lower_case_string from customtype_uppercases where id=' . $entity->id . ''), 'Database holds uppercase string');
71
+        self::assertEquals('FOO', $this->em->getConnection()->fetchColumn('select named_lower_case_string from customtype_uppercases where id='.$entity->id.''), 'Database holds uppercase string');
72 72
 
73
-        $entity->namedLowerCaseString   = 'bar';
73
+        $entity->namedLowerCaseString = 'bar';
74 74
 
75 75
         $this->em->persist($entity);
76 76
         $this->em->flush();
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
         $entity = $this->em->find('\Doctrine\Tests\Models\CustomType\CustomTypeUpperCase', $id);
83 83
         self::assertEquals('bar', $entity->namedLowerCaseString, 'Entity holds lowercase string');
84
-        self::assertEquals('BAR', $this->em->getConnection()->fetchColumn('select named_lower_case_string from customtype_uppercases where id=' . $entity->id . ''), 'Database holds uppercase string');
84
+        self::assertEquals('BAR', $this->em->getConnection()->fetchColumn('select named_lower_case_string from customtype_uppercases where id='.$entity->id.''), 'Database holds uppercase string');
85 85
     }
86 86
 
87 87
     public function testTypeValueSqlWithAssociations()
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $entity = $this->em->find(CustomTypeParent::class, $parentId);
109 109
 
110 110
         self::assertTrue($entity->customInteger < 0, 'Fetched customInteger negative');
111
-        self::assertEquals(1, $this->em->getConnection()->fetchColumn('select customInteger from customtype_parents where id=' . $entity->id . ''), 'Database has stored customInteger positive');
111
+        self::assertEquals(1, $this->em->getConnection()->fetchColumn('select customInteger from customtype_parents where id='.$entity->id.''), 'Database has stored customInteger positive');
112 112
 
113 113
         self::assertNotNull($parent->child, 'Child attached');
114 114
         self::assertCount(2, $entity->getMyFriends(), '2 friends attached');
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
         $this->em->clear();
129 129
 
130
-        $query = $this->em->createQuery("SELECT p, p.customInteger, c from Doctrine\Tests\Models\CustomType\CustomTypeParent p JOIN p.child c where p.id = " . $parentId);
130
+        $query = $this->em->createQuery("SELECT p, p.customInteger, c from Doctrine\Tests\Models\CustomType\CustomTypeParent p JOIN p.child c where p.id = ".$parentId);
131 131
 
132 132
         $result = $query->getResult();
133 133
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php 1 patch
Spacing   +5 added lines, -5 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\Tests\ORM\Functional\Ticket;
6 6
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
                 ]
27 27
             );
28 28
         } catch (\Exception $e) {
29
-            $this->fail($e->getMessage() . PHP_EOL . $e->getTraceAsString());
29
+            $this->fail($e->getMessage().PHP_EOL.$e->getTraceAsString());
30 30
         }
31 31
     }
32 32
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $conn = static::$sharedConn;
36 36
 
37 37
         // In case test is skipped, tearDown is called, but no setup may have run
38
-        if (! $conn) {
38
+        if ( ! $conn) {
39 39
             return;
40 40
         }
41 41
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
         $baz = $this->em->find(get_class($baz), $baz->id);
79 79
         foreach ($baz->foos as $foo) {
80
-            self::assertEquals(1, $foo->loaded, 'should have loaded callback counter incremented for ' . get_class($foo));
80
+            self::assertEquals(1, $foo->loaded, 'should have loaded callback counter incremented for '.get_class($foo));
81 81
         }
82 82
     }
83 83
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         self::assertEquals(1, $bar->loaded);
102 102
         self::assertEquals(1, $bar->subLoaded);
103 103
 
104
-        $dql = 'SELECT b FROM ' . __NAMESPACE__ . "\DDC1655Bar b WHERE b.id = ?1";
104
+        $dql = 'SELECT b FROM '.__NAMESPACE__."\DDC1655Bar b WHERE b.id = ?1";
105 105
         $bar = $this->em->createQuery($dql)->setParameter(1, $bar->id)->getSingleResult();
106 106
 
107 107
         self::assertEquals(1, $bar->loaded);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.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\Tests\ORM\Functional\Ticket;
6 6
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function testIssue()
24 24
     {
25
-        $dql = 'SELECT n.smallText, n.publishDate FROM ' . __NAMESPACE__ . '\\DDC1695News n';
25
+        $dql = 'SELECT n.smallText, n.publishDate FROM '.__NAMESPACE__.'\\DDC1695News n';
26 26
         $sql = $this->em->createQuery($dql)->getSQL();
27 27
 
28 28
         self::assertEquals(
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.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\Tests\ORM\Functional\Ticket;
6 6
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $this->em->clear();
46 46
 
47 47
         $query = $this->em->createQuery(
48
-            'SELECT x, y, z FROM Doctrine\Tests\ORM\Functional\Ticket\DDC279EntityX x ' .
48
+            'SELECT x, y, z FROM Doctrine\Tests\ORM\Functional\Ticket\DDC279EntityX x '.
49 49
             'INNER JOIN x.y y INNER JOIN y.z z WHERE x.id = ?1'
50 50
         )->setParameter(1, $x->id);
51 51
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/GH6217Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\Functional\Ticket;
6 6
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.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\Tests\ORM\Functional\Ticket;
6 6
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     {
27 27
         //$this->em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
28 28
 
29
-        $num = $this->em->createQuery('DELETE ' . __NAMESPACE__ . '\DDC425Entity e WHERE e.someDatetimeField > ?1')
29
+        $num = $this->em->createQuery('DELETE '.__NAMESPACE__.'\DDC425Entity e WHERE e.someDatetimeField > ?1')
30 30
                 ->setParameter(1, new DateTime, Type::DATETIME)
31 31
                 ->getResult();
32 32
         self::assertEquals(0, $num);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.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\Tests\ORM\Functional\Ticket;
6 6
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $this->em->flush();
66 66
         $this->em->clear();
67 67
 
68
-        $appointments = $this->em->createQuery('SELECT a FROM ' . __NAMESPACE__ . "\DDC633Appointment a")->getResult();
68
+        $appointments = $this->em->createQuery('SELECT a FROM '.__NAMESPACE__."\DDC633Appointment a")->getResult();
69 69
 
70 70
         foreach ($appointments as $eagerAppointment) {
71 71
             self::assertInstanceOf(GhostObjectInterface::class, $eagerAppointment->patient);
Please login to merge, or discard this patch.