Failed Conditions
Pull Request — master (#7885)
by Šimon
11:22
created
lib/Doctrine/ORM/AbstractQuery.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     public function getParameter($key)
303 303
     {
304 304
         $filteredParameters = $this->parameters->filter(
305
-            static function (Query\Parameter $parameter) use ($key) : bool {
305
+            static function(Query\Parameter $parameter) use ($key) : bool {
306 306
                 $parameterName = $parameter->getName();
307 307
 
308 308
                 return $key === $parameterName || (string) $key === (string) $parameterName;
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
             return $value;
396 396
         }
397 397
 
398
-        if (! is_object($value)) {
398
+        if ( ! is_object($value)) {
399 399
             return $value;
400 400
         }
401 401
 
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
             return null;
727 727
         }
728 728
 
729
-        if (! is_array($result)) {
729
+        if ( ! is_array($result)) {
730 730
             return $result;
731 731
         }
732 732
 
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
             throw new NoResultException();
761 761
         }
762 762
 
763
-        if (! is_array($result)) {
763
+        if ( ! is_array($result)) {
764 764
             return $result;
765 765
         }
766 766
 
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
             $this->setHydrationMode($hydrationMode);
851 851
         }
852 852
 
853
-        if (! empty($parameters)) {
853
+        if ( ! empty($parameters)) {
854 854
             $this->setParameters($parameters);
855 855
         }
856 856
 
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
             $this->setHydrationMode($hydrationMode);
874 874
         }
875 875
 
876
-        if (! empty($parameters)) {
876
+        if ( ! empty($parameters)) {
877 877
             $this->setParameters($parameters);
878 878
         }
879 879
 
@@ -912,11 +912,11 @@  discard block
 block discarded – undo
912 912
             $this->setHydrationMode($hydrationMode);
913 913
         }
914 914
 
915
-        if (! empty($parameters)) {
915
+        if ( ! empty($parameters)) {
916 916
             $this->setParameters($parameters);
917 917
         }
918 918
 
919
-        $setCacheEntry = static function () {
919
+        $setCacheEntry = static function() {
920 920
         };
921 921
 
922 922
         if ($this->hydrationCacheProfile !== null) {
@@ -930,11 +930,11 @@  discard block
 block discarded – undo
930 930
                 return $result[$realCacheKey];
931 931
             }
932 932
 
933
-            if (! $result) {
933
+            if ( ! $result) {
934 934
                 $result = [];
935 935
             }
936 936
 
937
-            $setCacheEntry = static function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) {
937
+            $setCacheEntry = static function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) {
938 938
                 $result[$realCacheKey] = $data;
939 939
 
940 940
                 $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime());
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
     {
1097 1097
         $query  = $this->getSQL();
1098 1098
         $hints  = $this->getHints();
1099
-        $params = array_map(function (Parameter $parameter) {
1099
+        $params = array_map(function(Parameter $parameter) {
1100 1100
             $value = $parameter->getValue();
1101 1101
 
1102 1102
             // Small optimization
@@ -1110,6 +1110,6 @@  discard block
 block discarded – undo
1110 1110
 
1111 1111
         ksort($hints);
1112 1112
 
1113
-        return sha1($query . '-' . serialize($params) . '-' . serialize($hints));
1113
+        return sha1($query.'-'.serialize($params).'-'.serialize($hints));
1114 1114
     }
1115 1115
 }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
         $this->putTripAroundEurope();
120 120
 
121 121
         $dql = 'SELECT t, p, c '
122
-             . 'FROM Doctrine\Tests\Models\Navigation\NavTour t '
123
-             . 'INNER JOIN t.pois p '
124
-             . 'INNER JOIN p.country c';
122
+                . 'FROM Doctrine\Tests\Models\Navigation\NavTour t '
123
+                . 'INNER JOIN t.pois p '
124
+                . 'INNER JOIN p.country c';
125 125
 
126 126
         $query = $this->em->createQuery($dql);
127 127
         $tours = $query->getResult();
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
         $this->putTripAroundEurope();
142 142
 
143 143
         $dql = 'SELECT t '
144
-             . 'FROM Doctrine\Tests\Models\Navigation\NavTour t '
145
-             . ', Doctrine\Tests\Models\Navigation\NavPointOfInterest p '
146
-             . 'WHERE p MEMBER OF t.pois';
144
+                . 'FROM Doctrine\Tests\Models\Navigation\NavTour t '
145
+                . ', Doctrine\Tests\Models\Navigation\NavPointOfInterest p '
146
+                . 'WHERE p MEMBER OF t.pois';
147 147
 
148 148
         $query = $this->em->createQuery($dql);
149 149
         $tours = $query->getResult();
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
     public function testBulkUpdateIssueDDC368() : void
327 327
     {
328 328
         $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.salary = 1')
329
-                  ->execute();
329
+                    ->execute();
330 330
 
331 331
         $query  = $this->em->createQuery('SELECT count(p.id) FROM ' . CompanyEmployee::class . ' p WHERE p.salary = 1');
332 332
         $result = $query->getResult();
@@ -344,9 +344,9 @@  discard block
 block discarded – undo
344 344
     public function testBulkUpdateNonScalarParameterDDC1341() : void
345 345
     {
346 346
         $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.startDate = ?0 WHERE p.department = ?1')
347
-                  ->setParameter(0, new DateTime())
348
-                  ->setParameter(1, 'IT')
349
-                  ->execute();
347
+                    ->setParameter(0, new DateTime())
348
+                    ->setParameter(1, 'IT')
349
+                    ->execute();
350 350
 
351 351
         self::addToAssertionCount(1);
352 352
     }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $this->em->clear();
53 53
 
54
-        $query = $this->em->createQuery('select p from ' . CompanyPerson::class . ' p order by p.name desc');
54
+        $query = $this->em->createQuery('select p from '.CompanyPerson::class.' p order by p.name desc');
55 55
 
56 56
         $entities = $query->getResult();
57 57
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         $this->em->clear();
72 72
 
73
-        $query = $this->em->createQuery('select p from ' . CompanyEmployee::class . ' p');
73
+        $query = $this->em->createQuery('select p from '.CompanyEmployee::class.' p');
74 74
 
75 75
         $entities = $query->getResult();
76 76
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         $this->em->clear();
95 95
 
96
-        $query = $this->em->createQuery('update ' . CompanyEmployee::class . " p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
96
+        $query = $this->em->createQuery('update '.CompanyEmployee::class." p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
97 97
 
98 98
         $query->setParameter(1, 'NewName', 'string');
99 99
         $query->setParameter(2, 'NewDepartment');
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
         self::assertEquals(1, $numUpdated);
106 106
 
107
-        $query = $this->em->createQuery('delete from ' . CompanyPerson::class . ' p');
107
+        $query = $this->em->createQuery('delete from '.CompanyPerson::class.' p');
108 108
 
109 109
         $numDeleted = $query->execute();
110 110
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $this->em->flush();
180 180
         $this->em->clear();
181 181
 
182
-        $query = $this->em->createQuery('select p, s from ' . CompanyPerson::class . ' p join p.spouse s where p.name=\'Mary Smith\'');
182
+        $query = $this->em->createQuery('select p, s from '.CompanyPerson::class.' p join p.spouse s where p.name=\'Mary Smith\'');
183 183
 
184 184
         $result = $query->getResult();
185 185
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
         $this->em->clear();
217 217
 
218
-        $query = $this->em->createQuery('select p, f from ' . CompanyPerson::class . ' p join p.friends f where p.name=?1');
218
+        $query = $this->em->createQuery('select p, f from '.CompanyPerson::class.' p join p.friends f where p.name=?1');
219 219
 
220 220
         $query->setParameter(1, 'Roman');
221 221
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         $this->em->flush();
286 286
         $this->em->clear();
287 287
 
288
-        $q = $this->em->createQuery('select a from ' . CompanyEvent::class . ' a where a.id = ?1');
288
+        $q = $this->em->createQuery('select a from '.CompanyEvent::class.' a where a.id = ?1');
289 289
 
290 290
         $q->setParameter(1, $event1->getId());
291 291
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
         $this->em->clear();
302 302
 
303
-        $q = $this->em->createQuery('select a from ' . CompanyOrganization::class . ' a where a.id = ?1');
303
+        $q = $this->em->createQuery('select a from '.CompanyOrganization::class.' a where a.id = ?1');
304 304
 
305 305
         $q->setParameter(1, $org->getId());
306 306
 
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
      */
326 326
     public function testBulkUpdateIssueDDC368() : void
327 327
     {
328
-        $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.salary = 1')
328
+        $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.salary = 1')
329 329
                   ->execute();
330 330
 
331
-        $query  = $this->em->createQuery('SELECT count(p.id) FROM ' . CompanyEmployee::class . ' p WHERE p.salary = 1');
331
+        $query  = $this->em->createQuery('SELECT count(p.id) FROM '.CompanyEmployee::class.' p WHERE p.salary = 1');
332 332
         $result = $query->getResult();
333 333
 
334 334
         self::assertGreaterThan(0, $result);
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
      */
344 344
     public function testBulkUpdateNonScalarParameterDDC1341() : void
345 345
     {
346
-        $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.startDate = ?0 WHERE p.department = ?1')
346
+        $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.startDate = ?0 WHERE p.department = ?1')
347 347
                   ->setParameter(0, new DateTime())
348 348
                   ->setParameter(1, 'IT')
349 349
                   ->execute();
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
         $this->em->flush();
402 402
         $this->em->clear();
403 403
 
404
-        $dqlManager = $this->em->createQuery('SELECT m FROM ' . CompanyManager::class . ' m WHERE m.spouse = ?1')
404
+        $dqlManager = $this->em->createQuery('SELECT m FROM '.CompanyManager::class.' m WHERE m.spouse = ?1')
405 405
                                 ->setParameter(1, $person->getId())
406 406
                                 ->getSingleResult();
407 407
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
     public function testAggregateWithHavingClause() : void
28 28
     {
29 29
         $dql = 'SELECT p.department, AVG(p.salary) AS avgSalary ' .
30
-               'FROM Doctrine\Tests\Models\Company\CompanyEmployee p ' .
31
-               'GROUP BY p.department HAVING SUM(p.salary) > 200000 ORDER BY p.department';
30
+                'FROM Doctrine\Tests\Models\Company\CompanyEmployee p ' .
31
+                'GROUP BY p.department HAVING SUM(p.salary) > 200000 ORDER BY p.department';
32 32
 
33 33
         $result = $this->em->createQuery($dql)->getScalarResult();
34 34
 
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     public function testUnnamedScalarResultsAreOneBased() : void
43 43
     {
44 44
         $dql = 'SELECT p.department, AVG(p.salary) ' .
45
-               'FROM Doctrine\Tests\Models\Company\CompanyEmployee p ' .
46
-               'GROUP BY p.department HAVING SUM(p.salary) > 200000 ORDER BY p.department';
45
+                'FROM Doctrine\Tests\Models\Company\CompanyEmployee p ' .
46
+                'GROUP BY p.department HAVING SUM(p.salary) > 200000 ORDER BY p.department';
47 47
 
48 48
         $result = $this->em->createQuery($dql)->getScalarResult();
49 49
 
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
     public function testOrderByResultVariableCollectionSize() : void
56 56
     {
57 57
         $dql = 'SELECT p.name, size(p.friends) AS friends ' .
58
-               'FROM Doctrine\Tests\Models\Company\CompanyPerson p ' .
59
-               'WHERE p.friends IS NOT EMPTY ' .
60
-               'ORDER BY friends DESC, p.name DESC';
58
+                'FROM Doctrine\Tests\Models\Company\CompanyPerson p ' .
59
+                'WHERE p.friends IS NOT EMPTY ' .
60
+                'ORDER BY friends DESC, p.name DESC';
61 61
 
62 62
         $result = $this->em->createQuery($dql)->getScalarResult();
63 63
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function testIsNullAssociation() : void
80 80
     {
81 81
         $dql    = 'SELECT p FROM Doctrine\Tests\Models\Company\CompanyPerson p ' .
82
-               'WHERE p.spouse IS NULL';
82
+                'WHERE p.spouse IS NULL';
83 83
         $query  = $this->em->createQuery($dql);
84 84
         $result = $query->getResult();
85 85
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     public function testSelectSubselect() : void
99 99
     {
100 100
         $dql    = 'SELECT p, (SELECT c.brand FROM Doctrine\Tests\Models\Company\CompanyCar c WHERE p.car = c) brandName ' .
101
-               'FROM Doctrine\Tests\Models\Company\CompanyManager p';
101
+                'FROM Doctrine\Tests\Models\Company\CompanyManager p';
102 102
         $query  = $this->em->createQuery($dql);
103 103
         $result = $query->getArrayResult();
104 104
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     public function testInSubselect() : void
114 114
     {
115 115
         $dql    = 'SELECT p.name FROM Doctrine\Tests\Models\Company\CompanyPerson p ' .
116
-               "WHERE p.name IN (SELECT n.name FROM Doctrine\Tests\Models\Company\CompanyPerson n WHERE n.name = 'Roman B.')";
116
+                "WHERE p.name IN (SELECT n.name FROM Doctrine\Tests\Models\Company\CompanyPerson n WHERE n.name = 'Roman B.')";
117 117
         $query  = $this->em->createQuery($dql);
118 118
         $result = $query->getScalarResult();
119 119
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     public function testGroupByMultipleFields() : void
129 129
     {
130 130
         $dql    = 'SELECT p.department, p.name, count(p.id) FROM Doctrine\Tests\Models\Company\CompanyEmployee p ' .
131
-               'GROUP BY p.department, p.name';
131
+                'GROUP BY p.department, p.name';
132 132
         $query  = $this->em->createQuery($dql);
133 133
         $result = $query->getResult();
134 134
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function testAggregateWithHavingClause() : void
28 28
     {
29
-        $dql = 'SELECT p.department, AVG(p.salary) AS avgSalary ' .
30
-               'FROM Doctrine\Tests\Models\Company\CompanyEmployee p ' .
29
+        $dql = 'SELECT p.department, AVG(p.salary) AS avgSalary '.
30
+               'FROM Doctrine\Tests\Models\Company\CompanyEmployee p '.
31 31
                'GROUP BY p.department HAVING SUM(p.salary) > 200000 ORDER BY p.department';
32 32
 
33 33
         $result = $this->em->createQuery($dql)->getScalarResult();
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function testUnnamedScalarResultsAreOneBased() : void
43 43
     {
44
-        $dql = 'SELECT p.department, AVG(p.salary) ' .
45
-               'FROM Doctrine\Tests\Models\Company\CompanyEmployee p ' .
44
+        $dql = 'SELECT p.department, AVG(p.salary) '.
45
+               'FROM Doctrine\Tests\Models\Company\CompanyEmployee p '.
46 46
                'GROUP BY p.department HAVING SUM(p.salary) > 200000 ORDER BY p.department';
47 47
 
48 48
         $result = $this->em->createQuery($dql)->getScalarResult();
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function testOrderByResultVariableCollectionSize() : void
56 56
     {
57
-        $dql = 'SELECT p.name, size(p.friends) AS friends ' .
58
-               'FROM Doctrine\Tests\Models\Company\CompanyPerson p ' .
59
-               'WHERE p.friends IS NOT EMPTY ' .
57
+        $dql = 'SELECT p.name, size(p.friends) AS friends '.
58
+               'FROM Doctrine\Tests\Models\Company\CompanyPerson p '.
59
+               'WHERE p.friends IS NOT EMPTY '.
60 60
                'ORDER BY friends DESC, p.name DESC';
61 61
 
62 62
         $result = $this->em->createQuery($dql)->getScalarResult();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
     public function testIsNullAssociation() : void
80 80
     {
81
-        $dql    = 'SELECT p FROM Doctrine\Tests\Models\Company\CompanyPerson p ' .
81
+        $dql    = 'SELECT p FROM Doctrine\Tests\Models\Company\CompanyPerson p '.
82 82
                'WHERE p.spouse IS NULL';
83 83
         $query  = $this->em->createQuery($dql);
84 84
         $result = $query->getResult();
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
     public function testSelectSubselect() : void
99 99
     {
100
-        $dql    = 'SELECT p, (SELECT c.brand FROM Doctrine\Tests\Models\Company\CompanyCar c WHERE p.car = c) brandName ' .
100
+        $dql    = 'SELECT p, (SELECT c.brand FROM Doctrine\Tests\Models\Company\CompanyCar c WHERE p.car = c) brandName '.
101 101
                'FROM Doctrine\Tests\Models\Company\CompanyManager p';
102 102
         $query  = $this->em->createQuery($dql);
103 103
         $result = $query->getArrayResult();
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
     public function testInSubselect() : void
114 114
     {
115
-        $dql    = 'SELECT p.name FROM Doctrine\Tests\Models\Company\CompanyPerson p ' .
115
+        $dql    = 'SELECT p.name FROM Doctrine\Tests\Models\Company\CompanyPerson p '.
116 116
                "WHERE p.name IN (SELECT n.name FROM Doctrine\Tests\Models\Company\CompanyPerson n WHERE n.name = 'Roman B.')";
117 117
         $query  = $this->em->createQuery($dql);
118 118
         $result = $query->getScalarResult();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     public function testGroupByMultipleFields() : void
129 129
     {
130
-        $dql    = 'SELECT p.department, p.name, count(p.id) FROM Doctrine\Tests\Models\Company\CompanyEmployee p ' .
130
+        $dql    = 'SELECT p.department, p.name, count(p.id) FROM Doctrine\Tests\Models\Company\CompanyEmployee p '.
131 131
                'GROUP BY p.department, p.name';
132 132
         $query  = $this->em->createQuery($dql);
133 133
         $result = $query->getResult();
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -273,7 +273,7 @@
 block discarded – undo
273 273
         $this->em->flush();
274 274
         $this->em->clear();
275 275
 
276
-        $query  = $this->em->createQuery(
276
+        $query = $this->em->createQuery(
277 277
             'SELECT e FROM Doctrine\Tests\ORM\Functional\LifecycleCallbackTestEntity AS e'
278 278
         );
279 279
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/QueryTest.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $this->em->flush();
96 96
         $this->em->clear();
97 97
 
98
-        $query = $this->em->createQuery('select u, a from ' . CmsUser::class . ' u join u.articles a ORDER BY a.topic');
98
+        $query = $this->em->createQuery('select u, a from '.CmsUser::class.' u join u.articles a ORDER BY a.topic');
99 99
         $users = $query->getResult();
100 100
 
101 101
         self::assertCount(1, $users);
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $this->em->flush();
116 116
         $this->em->clear();
117 117
 
118
-        $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.username = ?0');
118
+        $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.username = ?0');
119 119
         $q->setParameter(0, 'jwage');
120 120
         $user = $q->getSingleResult();
121 121
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $this->expectException(QueryException::class);
128 128
         $this->expectExceptionMessage('Invalid parameter: token 2 is not defined in the query.');
129 129
 
130
-        $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1');
130
+        $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1');
131 131
         $q->setParameter(2, 'jwage');
132 132
         $user = $q->getSingleResult();
133 133
     }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $this->expectException(QueryException::class);
138 138
         $this->expectExceptionMessage('Too many parameters: the query defines 1 parameters and you bound 2');
139 139
 
140
-        $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1');
140
+        $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1');
141 141
         $q->setParameter(1, 'jwage');
142 142
         $q->setParameter(2, 'jwage');
143 143
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $this->expectException(QueryException::class);
150 150
         $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0');
151 151
 
152
-        $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1')
152
+        $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1')
153 153
                   ->getSingleResult();
154 154
     }
155 155
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     {
158 158
         $this->expectException(QueryException::class);
159 159
 
160
-        $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?')
160
+        $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?')
161 161
                   ->setParameter(1, 'jwage')
162 162
                   ->getSingleResult();
163 163
     }
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
         $parameters->add(new Parameter(1, 'jwage'));
169 169
         $parameters->add(new Parameter(2, 'active'));
170 170
 
171
-        $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2')
171
+        $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2')
172 172
                   ->setParameters($parameters)
173 173
                   ->getResult();
174 174
 
175
-        $extractValue = static function (Parameter $parameter) {
175
+        $extractValue = static function(Parameter $parameter) {
176 176
             return $parameter->getValue();
177 177
         };
178 178
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     {
187 187
         $parameters = [1 => 'jwage', 2 => 'active'];
188 188
 
189
-        $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2')
189
+        $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2')
190 190
                   ->setParameters($parameters)
191 191
                   ->getResult();
192 192
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         $this->em->clear();
217 217
         $articleId = $article1->id;
218 218
 
219
-        $query    = $this->em->createQuery('select a from ' . CmsArticle::class . ' a WHERE a.topic = ?1');
219
+        $query    = $this->em->createQuery('select a from '.CmsArticle::class.' a WHERE a.topic = ?1');
220 220
         $articles = $query->iterate(new ArrayCollection([new Parameter(1, 'Doctrine 2')]), Query::HYDRATE_ARRAY);
221 221
 
222 222
         $expectedArticle = [
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $this->em->flush();
278 278
         $this->em->clear();
279 279
 
280
-        $query    = $this->em->createQuery('select a from ' . CmsArticle::class . ' a');
280
+        $query    = $this->em->createQuery('select a from '.CmsArticle::class.' a');
281 281
         $articles = $query->iterate();
282 282
 
283 283
         $iteratedCount = 0;
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
     {
379 379
         $this->expectException(QueryException::class);
380 380
 
381
-        $query    = $this->em->createQuery("SELECT u, a FROM ' . CmsUser::class . ' u JOIN u.articles a");
381
+        $query = $this->em->createQuery("SELECT u, a FROM ' . CmsUser::class . ' u JOIN u.articles a");
382 382
         $query->getIterable();
383 383
     }
384 384
 
@@ -435,8 +435,8 @@  discard block
 block discarded – undo
435 435
     {
436 436
         for ($i = 0; $i < 5; $i++) {
437 437
             $user           = new CmsUser();
438
-            $user->name     = 'Guilherme' . $i;
439
-            $user->username = 'gblanco' . $i;
438
+            $user->name     = 'Guilherme'.$i;
439
+            $user->username = 'gblanco'.$i;
440 440
             $user->status   = 'developer';
441 441
             $this->em->persist($user);
442 442
         }
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
         $this->em->flush();
445 445
         $this->em->clear();
446 446
 
447
-        $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
447
+        $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u')
448 448
                   ->setFirstResult(1)
449 449
                   ->setMaxResults(2)
450 450
                   ->getResult();
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
         self::assertEquals('gblanco1', $data[0]->username);
454 454
         self::assertEquals('gblanco2', $data[1]->username);
455 455
 
456
-        $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
456
+        $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u')
457 457
                   ->setFirstResult(3)
458 458
                   ->setMaxResults(2)
459 459
                   ->getResult();
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
         self::assertEquals('gblanco3', $data[0]->username);
463 463
         self::assertEquals('gblanco4', $data[1]->username);
464 464
 
465
-        $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
465
+        $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u')
466 466
                   ->setFirstResult(3)
467 467
                   ->setMaxResults(2)
468 468
                   ->getScalarResult();
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
             $author = new CmsUser();
519 519
 
520 520
             $author->name     = 'anonymous';
521
-            $author->username = 'anon' . $i;
521
+            $author->username = 'anon'.$i;
522 522
             $author->status   = 'here';
523 523
             $article->user    = $author;
524 524
 
@@ -554,13 +554,13 @@  discard block
 block discarded – undo
554 554
         $this->em->flush();
555 555
         $this->em->clear();
556 556
 
557
-        $query       = $this->em->createQuery('select u from ' . CmsUser::class . " u where u.username = 'gblanco'");
557
+        $query       = $this->em->createQuery('select u from '.CmsUser::class." u where u.username = 'gblanco'");
558 558
         $fetchedUser = $query->getOneOrNullResult();
559 559
 
560 560
         self::assertInstanceOf(CmsUser::class, $fetchedUser);
561 561
         self::assertEquals('gblanco', $fetchedUser->username);
562 562
 
563
-        $query           = $this->em->createQuery('select u.username from ' . CmsUser::class . " u where u.username = 'gblanco'");
563
+        $query           = $this->em->createQuery('select u.username from '.CmsUser::class." u where u.username = 'gblanco'");
564 564
         $fetchedUsername = $query->getOneOrNullResult(Query::HYDRATE_SINGLE_SCALAR);
565 565
 
566 566
         self::assertEquals('gblanco', $fetchedUsername);
Please login to merge, or discard this patch.