Passed
Pull Request — master (#7230)
by Grégoire
16:18
created
tests/Doctrine/Tests/Mocks/HydratorMockStatement.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,9 @@
 block discarded – undo
46 46
     public function fetchColumn($columnNumber = 0)
47 47
     {
48 48
         $row = current($this->_resultSet);
49
-        if ( ! is_array($row)) return false;
49
+        if ( ! is_array($row)) {
50
+            return false;
51
+        }
50 52
         $val = array_shift($row);
51 53
         return $val !== null ? $val : false;
52 54
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Mocks/ConnectionMock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
     public function quote($input, $type = null)
96 96
     {
97 97
         if (is_string($input)) {
98
-            return "'" . $input . "'";
98
+            return "'".$input."'";
99 99
         }
100 100
         return $input;
101 101
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Mocks/StatementMock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     /**
36 36
      * {@inheritdoc}
37 37
      */
38
-    public function errorInfo(){}
38
+    public function errorInfo() {}
39 39
 
40 40
     /**
41 41
      * {@inheritdoc}
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Mocks/DriverConnectionMock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     /**
50 50
      * {@inheritdoc}
51 51
      */
52
-    public function quote($input, $type=\PDO::PARAM_STR)
52
+    public function quote($input, $type = \PDO::PARAM_STR)
53 53
     {
54 54
     }
55 55
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Mocks/EntityManagerMock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
     {
71 71
         if (null === $config) {
72 72
             $config = new Configuration();
73
-            $config->setProxyDir(__DIR__ . '/../Proxies');
73
+            $config->setProxyDir(__DIR__.'/../Proxies');
74 74
             $config->setProxyNamespace('Doctrine\Tests\Proxies');
75 75
             $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([], true));
76 76
         }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $this->_em->flush();
174 174
         $this->_em->detach($user);
175 175
 
176
-        $dql = 'SELECT u FROM ' . CmsUser::class . ' u WHERE u.id = ?1';
176
+        $dql = 'SELECT u FROM '.CmsUser::class.' u WHERE u.id = ?1';
177 177
         $query = $this->_em->createQuery($dql);
178 178
         $query->setParameter(1, $user);
179 179
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
         $this->_em->detach($article);
218 218
 
219
-        $sql = 'UPDATE cms_articles SET version = version + 1 WHERE id = ' . $article->id;
219
+        $sql = 'UPDATE cms_articles SET version = version + 1 WHERE id = '.$article->id;
220 220
         $this->_em->getConnection()->executeUpdate($sql);
221 221
 
222 222
         $this->expectException(OptimisticLockException::class);
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
-    	$this->assertNotSame($userAsc, $userDesc);
442
+        $this->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
-        $this->assertInstanceOf(CmsUser::class,$user);
183
+        $this->assertInstanceOf(CmsUser::class, $user);
184 184
         $this->assertEquals('Roman', $user->name);
185 185
         $this->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
         $this->assertEquals(2, count($users));
195
-        $this->assertInstanceOf(CmsUser::class,$users[0]);
195
+        $this->assertInstanceOf(CmsUser::class, $users[0]);
196 196
         $this->assertEquals('Guilherme', $users[0]->name);
197 197
         $this->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
         $this->assertEquals(2, count($addresses));
221
-        $this->assertInstanceOf(CmsAddress::class,$addresses[0]);
221
+        $this->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
         $this->assertEquals(2, count($addresses));
245
-        $this->assertInstanceOf(CmsAddress::class,$addresses[0]);
245
+        $this->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
         $this->assertEquals(2, count($users));
255
-        $this->assertInstanceOf(CmsUser::class,$users[0]);
255
+        $this->assertInstanceOf(CmsUser::class, $users[0]);
256 256
         $this->assertEquals('Guilherme', $users[0]->name);
257 257
         $this->assertEquals('dev', $users[0]->status);
258 258
     }
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
         $this->assertEquals(2, count($usersAsc));
593 593
         $this->assertEquals(2, count($usersDesc));
594 594
 
595
-        $this->assertInstanceOf(CmsUser::class,$usersAsc[0]);
595
+        $this->assertInstanceOf(CmsUser::class, $usersAsc[0]);
596 596
         $this->assertEquals('Alexander', $usersAsc[0]->name);
597 597
         $this->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
         $this->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
-        $this->assertEquals([1,2,3], $query['params'][0]);
714
+        $this->assertEquals([1, 2, 3], $query['params'][0]);
715 715
         $this->assertEquals(Connection::PARAM_INT_ARRAY, $query['types'][0]);
716 716
     }
717 717
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php 2 patches
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
         $this->assertEquals(0, count($newUser->groups));
271 271
         $this->assertInternalType('array', $newUser->groups->getMapping());
272 272
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -290,9 +290,9 @@  discard block
 block discarded – undo
290 290
         $user->username = 'gblanco';
291 291
         $user->status = 'developer';
292 292
 
293
-        for ($i=0; $i < $groupCount; ++$i) {
293
+        for ($i = 0; $i < $groupCount; ++$i) {
294 294
             $group = new CmsGroup;
295
-            $group->name = 'Developers_' . $i;
295
+            $group->name = 'Developers_'.$i;
296 296
             $user->addGroup($group);
297 297
         }
298 298
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
             $user
407 407
                 ->getGroups()
408 408
                 ->matching($criteria)
409
-                ->map(function (CmsGroup $group) {
409
+                ->map(function(CmsGroup $group) {
410 410
                     return $group->getName();
411 411
                 })
412 412
                 ->toArray()
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
             $user
451 451
                 ->getTags()
452 452
                 ->matching($criteria)
453
-                ->map(function (CmsTag $tag) {
453
+                ->map(function(CmsTag $tag) {
454 454
                     return $tag->getName();
455 455
                 })
456 456
                 ->toArray()
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -237,10 +237,10 @@
 block discarded – undo
237 237
     {
238 238
         $config = new Configuration();
239 239
 
240
-        $config->setProxyDir(realpath(__DIR__ . '/../../Proxies'));
240
+        $config->setProxyDir(realpath(__DIR__.'/../../Proxies'));
241 241
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
242 242
         $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver(
243
-            [realpath(__DIR__ . '/../../Models/Cache')],
243
+            [realpath(__DIR__.'/../../Models/Cache')],
244 244
             true
245 245
         ));
246 246
         $config->setSQLLogger($logger);
Please login to merge, or discard this patch.