Failed Conditions
Pull Request — master (#6762)
by Claudio
19:02
created
tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
         $fix = new CompanyFixContract();
36 36
         $fix->setFixPrice(2000);
37 37
 
38
-        $this->listener->preFlushCalls  = [];
38
+        $this->listener->preFlushCalls = [];
39 39
 
40 40
         $this->_em->persist($fix);
41 41
         $this->_em->flush();
42 42
 
43
-        self::assertCount(1,$this->listener->preFlushCalls);
43
+        self::assertCount(1, $this->listener->preFlushCalls);
44 44
         self::assertSame($fix, $this->listener->preFlushCalls[0][0]);
45 45
         self::assertInstanceOf(CompanyFixContract::class, $this->listener->preFlushCalls[0][0]);
46 46
         self::assertInstanceOf(PreFlushEventArgs::class, $this->listener->preFlushCalls[0][1]);
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
         $this->_em->flush();
56 56
         $this->_em->clear();
57 57
 
58
-        $this->listener->postLoadCalls  = [];
58
+        $this->listener->postLoadCalls = [];
59 59
 
60 60
         $dql = "SELECT f FROM Doctrine\Tests\Models\Company\CompanyFixContract f WHERE f.id = ?1";
61 61
         $fix = $this->_em->createQuery($dql)->setParameter(1, $fix->getId())->getSingleResult();
62 62
 
63
-        self::assertCount(1,$this->listener->postLoadCalls);
63
+        self::assertCount(1, $this->listener->postLoadCalls);
64 64
         self::assertSame($fix, $this->listener->postLoadCalls[0][0]);
65 65
         self::assertInstanceOf(CompanyFixContract::class, $this->listener->postLoadCalls[0][0]);
66 66
         self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->postLoadCalls[0][1]);
@@ -71,12 +71,12 @@  discard block
 block discarded – undo
71 71
         $fix = new CompanyFixContract();
72 72
         $fix->setFixPrice(2000);
73 73
 
74
-        $this->listener->prePersistCalls  = [];
74
+        $this->listener->prePersistCalls = [];
75 75
 
76 76
         $this->_em->persist($fix);
77 77
         $this->_em->flush();
78 78
 
79
-        self::assertCount(1,$this->listener->prePersistCalls);
79
+        self::assertCount(1, $this->listener->prePersistCalls);
80 80
         self::assertSame($fix, $this->listener->prePersistCalls[0][0]);
81 81
         self::assertInstanceOf(CompanyFixContract::class, $this->listener->prePersistCalls[0][0]);
82 82
         self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->prePersistCalls[0][1]);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $this->_em->persist($fix);
93 93
         $this->_em->flush();
94 94
 
95
-        self::assertCount(1,$this->listener->postPersistCalls);
95
+        self::assertCount(1, $this->listener->postPersistCalls);
96 96
         self::assertSame($fix, $this->listener->postPersistCalls[0][0]);
97 97
         self::assertInstanceOf(CompanyFixContract::class, $this->listener->postPersistCalls[0][0]);
98 98
         self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->postPersistCalls[0][1]);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->_em->persist($fix);
114 114
         $this->_em->flush();
115 115
 
116
-        self::assertCount(1,$this->listener->preUpdateCalls);
116
+        self::assertCount(1, $this->listener->preUpdateCalls);
117 117
         self::assertSame($fix, $this->listener->preUpdateCalls[0][0]);
118 118
         self::assertInstanceOf(CompanyFixContract::class, $this->listener->preUpdateCalls[0][0]);
119 119
         self::assertInstanceOf(PreUpdateEventArgs::class, $this->listener->preUpdateCalls[0][1]);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $this->_em->persist($fix);
135 135
         $this->_em->flush();
136 136
 
137
-        self::assertCount(1,$this->listener->postUpdateCalls);
137
+        self::assertCount(1, $this->listener->postUpdateCalls);
138 138
         self::assertSame($fix, $this->listener->postUpdateCalls[0][0]);
139 139
         self::assertInstanceOf(CompanyFixContract::class, $this->listener->postUpdateCalls[0][0]);
140 140
         self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->postUpdateCalls[0][1]);
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         $this->_em->remove($fix);
154 154
         $this->_em->flush();
155 155
 
156
-        self::assertCount(1,$this->listener->preRemoveCalls);
156
+        self::assertCount(1, $this->listener->preRemoveCalls);
157 157
         self::assertSame($fix, $this->listener->preRemoveCalls[0][0]);
158 158
         self::assertInstanceOf(CompanyFixContract::class, $this->listener->preRemoveCalls[0][0]);
159 159
         self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->preRemoveCalls[0][1]);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         $this->_em->remove($fix);
173 173
         $this->_em->flush();
174 174
 
175
-        self::assertCount(1,$this->listener->postRemoveCalls);
175
+        self::assertCount(1, $this->listener->postRemoveCalls);
176 176
         self::assertSame($fix, $this->listener->postRemoveCalls[0][0]);
177 177
         self::assertInstanceOf(CompanyFixContract::class, $this->listener->postRemoveCalls[0][0]);
178 178
         self::assertInstanceOf(LifecycleEventArgs::class, $this->listener->postRemoveCalls[0][1]);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
         $this->_em->clear();
49 49
 
50
-        $query = $this->_em->createQuery('select p from ' . CompanyPerson::class . ' p order by p.name desc');
50
+        $query = $this->_em->createQuery('select p from '.CompanyPerson::class.' p order by p.name desc');
51 51
 
52 52
         $entities = $query->getResult();
53 53
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         $this->_em->clear();
64 64
 
65
-        $query = $this->_em->createQuery('select p from ' . CompanyEmployee::class . ' p');
65
+        $query = $this->_em->createQuery('select p from '.CompanyEmployee::class.' p');
66 66
 
67 67
         $entities = $query->getResult();
68 68
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
         $this->_em->clear();
82 82
 
83
-        $query = $this->_em->createQuery("update " . CompanyEmployee::class . " p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
83
+        $query = $this->_em->createQuery("update ".CompanyEmployee::class." p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
84 84
         $query->setParameter(1, 'NewName', 'string');
85 85
         $query->setParameter(2, 'NewDepartment');
86 86
         $query->setParameter(3, 100000);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $numUpdated = $query->execute();
89 89
         self::assertEquals(1, $numUpdated);
90 90
 
91
-        $query = $this->_em->createQuery('delete from ' . CompanyPerson::class . ' p');
91
+        $query = $this->_em->createQuery('delete from '.CompanyPerson::class.' p');
92 92
         $numDeleted = $query->execute();
93 93
         self::assertEquals(2, $numDeleted);
94 94
     }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $this->_em->flush();
162 162
         $this->_em->clear();
163 163
 
164
-        $query = $this->_em->createQuery('select p, s from ' . CompanyPerson::class . ' p join p.spouse s where p.name=\'Mary Smith\'');
164
+        $query = $this->_em->createQuery('select p, s from '.CompanyPerson::class.' p join p.spouse s where p.name=\'Mary Smith\'');
165 165
 
166 166
         $result = $query->getResult();
167 167
         self::assertCount(1, $result);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
         $this->_em->clear();
195 195
 
196
-        $query = $this->_em->createQuery('select p, f from ' . CompanyPerson::class . ' p join p.friends f where p.name=?1');
196
+        $query = $this->_em->createQuery('select p, f from '.CompanyPerson::class.' p join p.friends f where p.name=?1');
197 197
         $query->setParameter(1, 'Roman');
198 198
 
199 199
         $result = $query->getResult();
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
         $this->_em->flush();
256 256
         $this->_em->clear();
257 257
 
258
-        $q = $this->_em->createQuery('select a from ' . CompanyEvent::class . ' a where a.id = ?1');
258
+        $q = $this->_em->createQuery('select a from '.CompanyEvent::class.' a where a.id = ?1');
259 259
         $q->setParameter(1, $event1->getId());
260 260
 
261 261
         $result = $q->getResult();
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
         $this->_em->clear();
266 266
 
267
-        $q = $this->_em->createQuery('select a from ' . CompanyOrganization::class . ' a where a.id = ?1');
267
+        $q = $this->_em->createQuery('select a from '.CompanyOrganization::class.' a where a.id = ?1');
268 268
         $q->setParameter(1, $org->getId());
269 269
 
270 270
         $result = $q->getResult();
@@ -283,10 +283,10 @@  discard block
 block discarded – undo
283 283
      */
284 284
     public function testBulkUpdateIssueDDC368()
285 285
     {
286
-        $this->_em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.salary = 1')
286
+        $this->_em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.salary = 1')
287 287
                   ->execute();
288 288
 
289
-        $result = $this->_em->createQuery('SELECT count(p.id) FROM ' . CompanyEmployee::class . ' p WHERE p.salary = 1')
289
+        $result = $this->_em->createQuery('SELECT count(p.id) FROM '.CompanyEmployee::class.' p WHERE p.salary = 1')
290 290
                             ->getResult();
291 291
 
292 292
         self::assertGreaterThan(0, count($result));
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
      */
298 298
     public function testBulkUpdateNonScalarParameterDDC1341()
299 299
     {
300
-        $this->_em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.startDate = ?0 WHERE p.department = ?1')
300
+        $this->_em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.startDate = ?0 WHERE p.department = ?1')
301 301
                   ->setParameter(0, new \DateTime())
302 302
                   ->setParameter(1, 'IT')
303 303
                   ->execute();
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         $this->_em->flush();
356 356
         $this->_em->clear();
357 357
 
358
-        $dqlManager = $this->_em->createQuery('SELECT m FROM ' . CompanyManager::class . ' m WHERE m.spouse = ?1')
358
+        $dqlManager = $this->_em->createQuery('SELECT m FROM '.CompanyManager::class.' m WHERE m.spouse = ?1')
359 359
                                 ->setParameter(1, $person->getId())
360 360
                                 ->getSingleResult();
361 361
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         $this->putTripAroundEurope();
110 110
 
111 111
         $dql = 'SELECT t, p, c FROM Doctrine\Tests\Models\Navigation\NavTour t ' .
112
-               'INNER JOIN t.pois p INNER JOIN p.country c';
112
+                'INNER JOIN t.pois p INNER JOIN p.country c';
113 113
         $tours = $this->_em->createQuery($dql)->getResult();
114 114
 
115 115
         self::assertEquals(1, count($tours));
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
         $this->putTripAroundEurope();
129 129
 
130 130
         $dql = 'SELECT t FROM Doctrine\Tests\Models\Navigation\NavTour t, Doctrine\Tests\Models\Navigation\NavPointOfInterest p ' .
131
-               'WHERE p MEMBER OF t.pois';
131
+                'WHERE p MEMBER OF t.pois';
132 132
         $tours = $this->_em->createQuery($dql)
133
-                           ->getResult();
133
+                            ->getResult();
134 134
 
135 135
         self::assertEquals(1, count($tours));
136 136
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      */
309 309
     public function testExceptionIsThrownWhenCallingFindByWithoutParameter() {
310 310
         $this->_em->getRepository(CmsUser::class)
311
-                  ->findByStatus();
311
+                    ->findByStatus();
312 312
     }
313 313
 
314 314
     /**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
      */
317 317
     public function testExceptionIsThrownWhenUsingInvalidFieldName() {
318 318
         $this->_em->getRepository(CmsUser::class)
319
-                  ->findByThisFieldDoesNotExist('testvalue');
319
+                    ->findByThisFieldDoesNotExist('testvalue');
320 320
     }
321 321
 
322 322
     /**
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         $this->expectException(TransactionRequiredException::class);
329 329
 
330 330
         $this->_em->getRepository(CmsUser::class)
331
-                  ->find(1, LockMode::PESSIMISTIC_READ);
331
+                    ->find(1, LockMode::PESSIMISTIC_READ);
332 332
     }
333 333
 
334 334
     /**
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
         $this->expectException(TransactionRequiredException::class);
341 341
 
342 342
         $this->_em->getRepository(CmsUser::class)
343
-                  ->find(1, LockMode::PESSIMISTIC_WRITE);
343
+                    ->find(1, LockMode::PESSIMISTIC_WRITE);
344 344
     }
345 345
 
346 346
     /**
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
         $this->expectException(OptimisticLockException::class);
353 353
 
354 354
         $this->_em->getRepository(CmsUser::class)
355
-                  ->find(1, LockMode::OPTIMISTIC);
355
+                    ->find(1, LockMode::OPTIMISTIC);
356 356
     }
357 357
 
358 358
     /**
@@ -433,13 +433,13 @@  discard block
 block discarded – undo
433 433
      */
434 434
     public function testFindOneByOrderBy()
435 435
     {
436
-    	$this->loadFixture();
436
+        $this->loadFixture();
437 437
 
438
-    	$repos = $this->_em->getRepository(CmsUser::class);
439
-    	$userAsc = $repos->findOneBy([], ["username" => "ASC"]);
440
-    	$userDesc = $repos->findOneBy([], ["username" => "DESC"]);
438
+        $repos = $this->_em->getRepository(CmsUser::class);
439
+        $userAsc = $repos->findOneBy([], ["username" => "ASC"]);
440
+        $userDesc = $repos->findOneBy([], ["username" => "DESC"]);
441 441
 
442
-    	self::assertNotSame($userAsc, $userDesc);
442
+        self::assertNotSame($userAsc, $userDesc);
443 443
     }
444 444
 
445 445
     /**
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $repos = $this->_em->getRepository(CmsUser::class);
181 181
 
182 182
         $user = $repos->find($user1Id);
183
-        self::assertInstanceOf(CmsUser::class,$user);
183
+        self::assertInstanceOf(CmsUser::class, $user);
184 184
         self::assertEquals('Roman', $user->name);
185 185
         self::assertEquals('freak', $user->status);
186 186
     }
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
         $users = $repos->findBy(['status' => 'dev']);
194 194
         self::assertEquals(2, count($users));
195
-        self::assertInstanceOf(CmsUser::class,$users[0]);
195
+        self::assertInstanceOf(CmsUser::class, $users[0]);
196 196
         self::assertEquals('Guilherme', $users[0]->name);
197 197
         self::assertEquals('dev', $users[0]->status);
198 198
     }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $addresses  = $repository->findBy(['user' => [$user1->getId(), $user2->getId()]]);
219 219
 
220 220
         self::assertEquals(2, count($addresses));
221
-        self::assertInstanceOf(CmsAddress::class,$addresses[0]);
221
+        self::assertInstanceOf(CmsAddress::class, $addresses[0]);
222 222
     }
223 223
 
224 224
     public function testFindByAssociationWithObjectAsParameter()
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         $addresses  = $repository->findBy(['user' => [$user1, $user2]]);
243 243
 
244 244
         self::assertEquals(2, count($addresses));
245
-        self::assertInstanceOf(CmsAddress::class,$addresses[0]);
245
+        self::assertInstanceOf(CmsAddress::class, $addresses[0]);
246 246
     }
247 247
 
248 248
     public function testFindFieldByMagicCall()
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 
253 253
         $users = $repos->findByStatus('dev');
254 254
         self::assertEquals(2, count($users));
255
-        self::assertInstanceOf(CmsUser::class,$users[0]);
255
+        self::assertInstanceOf(CmsUser::class, $users[0]);
256 256
         self::assertEquals('Guilherme', $users[0]->name);
257 257
         self::assertEquals('dev', $users[0]->status);
258 258
     }
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
         self::assertEquals(2, count($usersAsc));
593 593
         self::assertEquals(2, count($usersDesc));
594 594
 
595
-        self::assertInstanceOf(CmsUser::class,$usersAsc[0]);
595
+        self::assertInstanceOf(CmsUser::class, $usersAsc[0]);
596 596
         self::assertEquals('Alexander', $usersAsc[0]->name);
597 597
         self::assertEquals('dev', $usersAsc[0]->status);
598 598
 
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
     public function testCanRetrieveRepositoryFromClassNameWithLeadingBackslash()
674 674
     {
675 675
         self::assertSame(
676
-            $this->_em->getRepository('\\' . CmsUser::class),
676
+            $this->_em->getRepository('\\'.CmsUser::class),
677 677
             $this->_em->getRepository(CmsUser::class)
678 678
         );
679 679
     }
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
         $data = $repo->findBy(['user' => [1, 2, 3]]);
712 712
 
713 713
         $query = array_pop($this->_sqlLoggerStack->queries);
714
-        self::assertEquals([1,2,3], $query['params'][0]);
714
+        self::assertEquals([1, 2, 3], $query['params'][0]);
715 715
         self::assertEquals(Connection::PARAM_INT_ARRAY, $query['types'][0]);
716 716
     }
717 717
 
Please login to merge, or discard this patch.
Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
         $this->_em->flush();
42 42
 
43 43
         self::assertForeignKeysContain($this->firstProduct->getId(),
44
-                                   $this->firstRelated->getId());
44
+                                    $this->firstRelated->getId());
45 45
         self::assertForeignKeysContain($this->firstProduct->getId(),
46
-                                   $this->secondRelated->getId());
46
+                                    $this->secondRelated->getId());
47 47
     }
48 48
 
49 49
     public function testRemovesAManyToManyAssociation()
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
         $this->_em->flush();
57 57
 
58 58
         self::assertForeignKeysNotContain($this->firstProduct->getId(),
59
-                                   $this->firstRelated->getId());
59
+                                    $this->firstRelated->getId());
60 60
         self::assertForeignKeysContain($this->firstProduct->getId(),
61
-                                   $this->secondRelated->getId());
61
+                                    $this->secondRelated->getId());
62 62
     }
63 63
 
64 64
     public function testEagerLoadsOwningSide()
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
-        self::assertEquals(0, count($sql), "SQL: " . implode(PHP_EOL, $sql));
90
+        self::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/ExtraLazyCollectionTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
         $queryCount = $this->getCurrentQueryCount();
297 297
         self::assertFalse($user->articles->contains($article));
298
-        self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed.");
298
+        self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed.");
299 299
         self::assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized.");
300 300
 
301 301
         // Test One to Many existence with state managed
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 
463 463
         $queryCount = $this->getCurrentQueryCount();
464 464
         self::assertTrue($group->users->contains($user));
465
-        self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed.");
465
+        self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed.");
466 466
         self::assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
467 467
 
468 468
         $newUser = new CmsUser();
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
         $user     = new User();
1243 1243
         $userList = new UserList();
1244 1244
 
1245
-        $user->name     = 'ocramius';
1245
+        $user->name = 'ocramius';
1246 1246
         $userList->listName = 'PHP Developers to follow closely';
1247 1247
 
1248 1248
         $user->addUserList($userList);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -265,8 +265,8 @@
 block discarded – undo
265 265
         $this->_em->clear();
266 266
 
267 267
         $newUser = $this->_em->createQuery('SELECT u, g FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.groups g WHERE u.id = ?1')
268
-                             ->setParameter(1, $user->getId())
269
-                             ->getSingleResult();
268
+                                ->setParameter(1, $user->getId())
269
+                                ->getSingleResult();
270 270
         self::assertEquals(0, count($newUser->groups));
271 271
         self::assertInternalType('array', $newUser->groups->getMapping());
272 272
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/QueryTest.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0');
149 149
 
150 150
         $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1')
151
-                  ->getSingleResult();
151
+                    ->getSingleResult();
152 152
     }
153 153
 
154 154
     public function testInvalidInputParameterThrowsException()
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
         $this->expectException(QueryException::class);
157 157
 
158 158
         $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?')
159
-                  ->setParameter(1, 'jwage')
160
-                  ->getSingleResult();
159
+                    ->setParameter(1, 'jwage')
160
+                    ->getSingleResult();
161 161
     }
162 162
 
163 163
     public function testSetParameters()
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
         $parameters->add(new Parameter(2, 'active'));
168 168
 
169 169
         $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2')
170
-                  ->setParameters($parameters)
171
-                  ->getResult();
170
+                    ->setParameters($parameters)
171
+                    ->getResult();
172 172
 
173 173
         $extractValue = function (Parameter $parameter) {
174 174
             return $parameter->getValue();
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
         $parameters = [1 => 'jwage', 2 => 'active'];
186 186
 
187 187
         $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2')
188
-                  ->setParameters($parameters)
189
-                  ->getResult();
188
+                    ->setParameters($parameters)
189
+                    ->getResult();
190 190
 
191 191
         self::assertSame(
192 192
             array_values($parameters),
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
     public function testGetSingleResultThrowsExceptionOnNoResult()
331 331
     {
332 332
         $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a")
333
-             ->getSingleResult();
333
+                ->getSingleResult();
334 334
     }
335 335
 
336 336
     /**
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
     public function testGetSingleScalarResultThrowsExceptionOnNoResult()
340 340
     {
341 341
         $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a")
342
-             ->getSingleScalarResult();
342
+                ->getSingleScalarResult();
343 343
     }
344 344
 
345 345
     /**
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         $this->_em->clear();
371 371
 
372 372
         $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a")
373
-             ->getSingleScalarResult();
373
+                ->getSingleScalarResult();
374 374
     }
375 375
 
376 376
     public function testModifiedLimitQuery()
@@ -387,27 +387,27 @@  discard block
 block discarded – undo
387 387
         $this->_em->clear();
388 388
 
389 389
         $data = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
390
-                  ->setFirstResult(1)
391
-                  ->setMaxResults(2)
392
-                  ->getResult();
390
+                    ->setFirstResult(1)
391
+                    ->setMaxResults(2)
392
+                    ->getResult();
393 393
 
394 394
         self::assertEquals(2, count($data));
395 395
         self::assertEquals('gblanco1', $data[0]->username);
396 396
         self::assertEquals('gblanco2', $data[1]->username);
397 397
 
398 398
         $data = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
399
-                  ->setFirstResult(3)
400
-                  ->setMaxResults(2)
401
-                  ->getResult();
399
+                    ->setFirstResult(3)
400
+                    ->setMaxResults(2)
401
+                    ->getResult();
402 402
 
403 403
         self::assertEquals(2, count($data));
404 404
         self::assertEquals('gblanco3', $data[0]->username);
405 405
         self::assertEquals('gblanco4', $data[1]->username);
406 406
 
407 407
         $data = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
408
-                  ->setFirstResult(3)
409
-                  ->setMaxResults(2)
410
-                  ->getScalarResult();
408
+                    ->setFirstResult(3)
409
+                    ->setMaxResults(2)
410
+                    ->getScalarResult();
411 411
     }
412 412
 
413 413
     public function testSupportsQueriesWithEntityNamespaces()
@@ -476,8 +476,8 @@  discard block
 block discarded – undo
476 476
         $this->_em->clear();
477 477
 
478 478
         $articles = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a')
479
-                         ->setFetchMode(CmsArticle::class, 'user', ClassMetadata::FETCH_EAGER)
480
-                         ->getResult();
479
+                            ->setFetchMode(CmsArticle::class, 'user', ClassMetadata::FETCH_EAGER)
480
+                            ->getResult();
481 481
 
482 482
         self::assertEquals(10, count($articles));
483 483
         foreach ($articles AS $article) {
@@ -619,9 +619,9 @@  discard block
 block discarded – undo
619 619
     {
620 620
         $qb = $this->_em->createQueryBuilder();
621 621
         $qb->select('u')
622
-           ->from(CmsUser::class, 'u')
623
-           ->innerJoin('u.articles', 'a')
624
-           ->where('(u.id = 0) OR (u.id IS NULL)');
622
+            ->from(CmsUser::class, 'u')
623
+            ->innerJoin('u.articles', 'a')
624
+            ->where('(u.id = 0) OR (u.id IS NULL)');
625 625
 
626 626
         $query = $qb->getQuery();
627 627
         $users = $query->execute();
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $this->_em->flush();
95 95
         $this->_em->clear();
96 96
 
97
-        $query = $this->_em->createQuery('select u, a from ' . CmsUser::class . ' u join u.articles a ORDER BY a.topic');
97
+        $query = $this->_em->createQuery('select u, a from '.CmsUser::class.' u join u.articles a ORDER BY a.topic');
98 98
         $users = $query->getResult();
99 99
         self::assertEquals(1, count($users));
100 100
         self::assertInstanceOf(CmsUser::class, $users[0]);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->_em->flush();
114 114
         $this->_em->clear();
115 115
 
116
-        $q = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.username = ?0');
116
+        $q = $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.username = ?0');
117 117
         $q->setParameter(0, 'jwage');
118 118
         $user = $q->getSingleResult();
119 119
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $this->expectException(QueryException::class);
126 126
         $this->expectExceptionMessage('Invalid parameter: token 2 is not defined in the query.');
127 127
 
128
-        $q = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1');
128
+        $q = $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1');
129 129
         $q->setParameter(2, 'jwage');
130 130
         $user = $q->getSingleResult();
131 131
     }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $this->expectException(QueryException::class);
136 136
         $this->expectExceptionMessage('Too many parameters: the query defines 1 parameters and you bound 2');
137 137
 
138
-        $q = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1');
138
+        $q = $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1');
139 139
         $q->setParameter(1, 'jwage');
140 140
         $q->setParameter(2, 'jwage');
141 141
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         $this->expectException(QueryException::class);
148 148
         $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0');
149 149
 
150
-        $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1')
150
+        $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1')
151 151
                   ->getSingleResult();
152 152
     }
153 153
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     {
156 156
         $this->expectException(QueryException::class);
157 157
 
158
-        $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?')
158
+        $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?')
159 159
                   ->setParameter(1, 'jwage')
160 160
                   ->getSingleResult();
161 161
     }
@@ -166,11 +166,11 @@  discard block
 block discarded – undo
166 166
         $parameters->add(new Parameter(1, 'jwage'));
167 167
         $parameters->add(new Parameter(2, 'active'));
168 168
 
169
-        $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2')
169
+        $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2')
170 170
                   ->setParameters($parameters)
171 171
                   ->getResult();
172 172
 
173
-        $extractValue = function (Parameter $parameter) {
173
+        $extractValue = function(Parameter $parameter) {
174 174
             return $parameter->getValue();
175 175
         };
176 176
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
     {
185 185
         $parameters = [1 => 'jwage', 2 => 'active'];
186 186
 
187
-        $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2')
187
+        $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2')
188 188
                   ->setParameters($parameters)
189 189
                   ->getResult();
190 190
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         $this->_em->clear();
215 215
         $articleId = $article1->id;
216 216
 
217
-        $query = $this->_em->createQuery('select a from ' . CmsArticle::class . ' a WHERE a.topic = ?1');
217
+        $query = $this->_em->createQuery('select a from '.CmsArticle::class.' a WHERE a.topic = ?1');
218 218
         $articles = $query->iterate(new ArrayCollection([new Parameter(1, 'Doctrine 2')]), Query::HYDRATE_ARRAY);
219 219
 
220 220
         $found = [];
@@ -255,19 +255,19 @@  discard block
 block discarded – undo
255 255
         $this->_em->flush();
256 256
         $this->_em->clear();
257 257
 
258
-        $query = $this->_em->createQuery('select a from ' . CmsArticle::class . ' a');
258
+        $query = $this->_em->createQuery('select a from '.CmsArticle::class.' a');
259 259
         $articles = $query->iterate();
260 260
 
261 261
         $iteratedCount = 0;
262 262
         $topics = [];
263 263
 
264
-        foreach($articles AS $row) {
264
+        foreach ($articles AS $row) {
265 265
             $article = $row[0];
266 266
             $topics[] = $article->topic;
267 267
 
268 268
             $identityMap = $this->_em->getUnitOfWork()->getIdentityMap();
269 269
             $identityMapCount = count($identityMap[CmsArticle::class]);
270
-            self::assertTrue($identityMapCount>$iteratedCount);
270
+            self::assertTrue($identityMapCount > $iteratedCount);
271 271
 
272 272
             $iteratedCount++;
273 273
         }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
         $iteratedCount = 0;
302 302
         $topics = [];
303
-        foreach($articles AS $row) {
303
+        foreach ($articles AS $row) {
304 304
             $article  = $row[0];
305 305
             $topics[] = $article->topic;
306 306
 
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
     {
378 378
         for ($i = 0; $i < 5; $i++) {
379 379
             $user = new CmsUser;
380
-            $user->name = 'Guilherme' . $i;
381
-            $user->username = 'gblanco' . $i;
380
+            $user->name = 'Guilherme'.$i;
381
+            $user->username = 'gblanco'.$i;
382 382
             $user->status = 'developer';
383 383
             $this->_em->persist($user);
384 384
         }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         $this->_em->flush();
387 387
         $this->_em->clear();
388 388
 
389
-        $data = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
389
+        $data = $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u')
390 390
                   ->setFirstResult(1)
391 391
                   ->setMaxResults(2)
392 392
                   ->getResult();
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
         self::assertEquals('gblanco1', $data[0]->username);
396 396
         self::assertEquals('gblanco2', $data[1]->username);
397 397
 
398
-        $data = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
398
+        $data = $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u')
399 399
                   ->setFirstResult(3)
400 400
                   ->setMaxResults(2)
401 401
                   ->getResult();
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         self::assertEquals('gblanco3', $data[0]->username);
405 405
         self::assertEquals('gblanco4', $data[1]->username);
406 406
 
407
-        $data = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
407
+        $data = $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u')
408 408
                   ->setFirstResult(3)
409 409
                   ->setMaxResults(2)
410 410
                   ->getScalarResult();
@@ -498,13 +498,13 @@  discard block
 block discarded – undo
498 498
         $this->_em->flush();
499 499
         $this->_em->clear();
500 500
 
501
-        $query = $this->_em->createQuery("select u from " . CmsUser::class . " u where u.username = 'gblanco'");
501
+        $query = $this->_em->createQuery("select u from ".CmsUser::class." u where u.username = 'gblanco'");
502 502
 
503 503
         $fetchedUser = $query->getOneOrNullResult();
504 504
         self::assertInstanceOf(CmsUser::class, $fetchedUser);
505 505
         self::assertEquals('gblanco', $fetchedUser->username);
506 506
 
507
-        $query = $this->_em->createQuery("select u.username from " . CmsUser::class . " u where u.username = 'gblanco'");
507
+        $query = $this->_em->createQuery("select u.username from ".CmsUser::class." u where u.username = 'gblanco'");
508 508
         $fetchedUsername = $query->getOneOrNullResult(Query::HYDRATE_SINGLE_SCALAR);
509 509
         self::assertEquals('gblanco', $fetchedUsername);
510 510
     }
Please login to merge, or discard this patch.