Completed
Pull Request — master (#7902)
by
unknown
63:54
created
tests/Doctrine/Performance/Query/QueryBoundParameterProcessingBench.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
         $this->parsedQueryWithDeclaredParameterType = $entityManager->createQuery($dql);
58 58
 
59 59
         foreach (\range(1, 10) as $index) {
60
-            $this->parsedQueryWithInferredParameterType->setParameter('parameter' . $index, new DateTime());
61
-            $this->parsedQueryWithDeclaredParameterType->setParameter('parameter' . $index, new DateTime(), DateTimeType::DATETIME);
60
+            $this->parsedQueryWithInferredParameterType->setParameter('parameter'.$index, new DateTime());
61
+            $this->parsedQueryWithDeclaredParameterType->setParameter('parameter'.$index, new DateTime(), DateTimeType::DATETIME);
62 62
         }
63 63
 
64 64
         // Force parsing upfront - we don't benchmark that bit in this scenario
Please login to merge, or discard this patch.
tests/Doctrine/Performance/EntityManagerFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $config = new Configuration();
27 27
 
28
-        $config->setProxyDir(__DIR__ . '/../Tests/Proxies');
28
+        $config->setProxyDir(__DIR__.'/../Tests/Proxies');
29 29
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
30 30
         $config->setAutoGenerateProxyClasses(StaticProxyFactory::AUTOGENERATE_EVAL);
31 31
         $config->setMetadataDriverImpl(
32 32
             $config->newDefaultAnnotationDriver([
33
-                \realpath(__DIR__ . '/Models/Cache'),
34
-                \realpath(__DIR__ . '/Models/GeoNames'),
33
+                \realpath(__DIR__.'/Models/Cache'),
34
+                \realpath(__DIR__.'/Models/GeoNames'),
35 35
             ])
36 36
         );
37 37
 
@@ -53,15 +53,15 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $config = new Configuration();
55 55
 
56
-        $config->setProxyDir(__DIR__ . '/../Tests/Proxies');
56
+        $config->setProxyDir(__DIR__.'/../Tests/Proxies');
57 57
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
58 58
         $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL);
59 59
         $config->setMetadataDriverImpl(
60 60
             $config->newDefaultAnnotationDriver(
61 61
                 [
62
-                    \realpath(__DIR__ . '/Models/Cache'),
63
-                    \realpath(__DIR__ . '/Models/Generic'),
64
-                    \realpath(__DIR__ . '/Models/GeoNames'),
62
+                    \realpath(__DIR__.'/Models/Cache'),
63
+                    \realpath(__DIR__.'/Models/Generic'),
64
+                    \realpath(__DIR__.'/Models/GeoNames'),
65 65
                 ]
66 66
             )
67 67
         );
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                     self::isInstanceOf(CompanyEmployee::class)
235 235
                 )
236 236
             )
237
-            ->willReturnCallback(static function (array $id, CompanyEmployee $companyEmployee) {
237
+            ->willReturnCallback(static function(array $id, CompanyEmployee $companyEmployee) {
238 238
                 $companyEmployee->setSalary(1000); // A property on the CompanyEmployee
239 239
                 $companyEmployee->setName('Bob'); // A property on the parent class, CompanyPerson
240 240
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                     self::isInstanceOf(ComparableObject::class)
297 297
                 )
298 298
             )
299
-            ->willReturnCallback(static function (array $id, ComparableObject $comparableObject) {
299
+            ->willReturnCallback(static function(array $id, ComparableObject $comparableObject) {
300 300
                 $comparableObject->setComparedFieldValue(\json_encode($id));
301 301
 
302 302
                 return $comparableObject;
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 $metadata,
71 71
                 Events::postLoad,
72 72
                 $entity,
73
-                $this->callback(static function (LifecycleEventArgs $args) use ($entityManager, $entity) {
73
+                $this->callback(static function(LifecycleEventArgs $args) use ($entityManager, $entity) {
74 74
                     return $entity === $args->getEntity() && $entityManager === $args->getObjectManager();
75 75
                 }),
76 76
                 $listenersFlag
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 $this->logicalOr($metadata1, $metadata2),
139 139
                 Events::postLoad,
140 140
                 $this->logicalOr($entity1, $entity2),
141
-                $this->callback(static function (LifecycleEventArgs $args) use ($entityManager, $entity1, $entity2) {
141
+                $this->callback(static function(LifecycleEventArgs $args) use ($entityManager, $entity1, $entity2) {
142 142
                     return \in_array($args->getEntity(), [$entity1, $entity2], true)
143 143
                         && $entityManager === $args->getObjectManager();
144 144
                 }),
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Tools/SetupTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function tearDown() : void
37 37
     {
38
-        if (! $this->originalIncludePath) {
38
+        if ( ! $this->originalIncludePath) {
39 39
             return;
40 40
         }
41 41
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $config = Setup::createConfiguration(false, __DIR__);
75 75
         $cache  = $config->getMetadataCacheImpl();
76 76
 
77
-        self::assertSame('dc2_' . \md5(__DIR__) . '_', $cache->getNamespace());
77
+        self::assertSame('dc2_'.\md5(__DIR__).'_', $cache->getNamespace());
78 78
     }
79 79
 
80 80
     /**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $config = Setup::createConfiguration(false, __DIR__, new ArrayCache());
86 86
         $cache  = $config->getMetadataCacheImpl();
87 87
 
88
-        self::assertSame('dc2_' . \md5(__DIR__) . '_', $cache->getNamespace());
88
+        self::assertSame('dc2_'.\md5(__DIR__).'_', $cache->getNamespace());
89 89
     }
90 90
 
91 91
     /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $cache  = $config->getMetadataCacheImpl();
101 101
 
102 102
         self::assertSame($originalCache, $cache);
103
-        self::assertSame('foo:dc2_' . \md5(__DIR__) . '_', $cache->getNamespace());
103
+        self::assertSame('foo:dc2_'.\md5(__DIR__).'_', $cache->getNamespace());
104 104
     }
105 105
 
106 106
     /**
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTestCase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $driver = new DatabaseDriver($sm);
65 65
 
66 66
         foreach ($driver->getAllClassNames() as $className) {
67
-            if (! \in_array(\strtolower($className), $classNames, true)) {
67
+            if ( ! \in_array(\strtolower($className), $classNames, true)) {
68 68
                 continue;
69 69
             }
70 70
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         }
75 75
 
76 76
         if (\count($metadataList) !== \count($classNames)) {
77
-            $this->fail("Have not found all classes matching the names '" . \implode(', ', $classNames) . "' only tables " . \implode(', ', \array_keys($metadataList)));
77
+            $this->fail("Have not found all classes matching the names '".\implode(', ', $classNames)."' only tables ".\implode(', ', \array_keys($metadataList)));
78 78
         }
79 79
 
80 80
         return $metadataList;
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/QueryTest.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0');
151 151
 
152 152
         $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1')
153
-                  ->getSingleResult();
153
+                    ->getSingleResult();
154 154
     }
155 155
 
156 156
     public function testInvalidInputParameterThrowsException() : void
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
         $this->expectException(QueryException::class);
159 159
 
160 160
         $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?')
161
-                  ->setParameter(1, 'jwage')
162
-                  ->getSingleResult();
161
+                    ->setParameter(1, 'jwage')
162
+                    ->getSingleResult();
163 163
     }
164 164
 
165 165
     public function testSetParameters() : void
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
         $parameters->add(new Parameter(2, 'active'));
170 170
 
171 171
         $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2')
172
-                  ->setParameters($parameters)
173
-                  ->getResult();
172
+                    ->setParameters($parameters)
173
+                    ->getResult();
174 174
 
175 175
         $extractValue = static function (Parameter $parameter) {
176 176
             return $parameter->getValue();
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
         $parameters = [1 => 'jwage', 2 => 'active'];
188 188
 
189 189
         $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2')
190
-                  ->setParameters($parameters)
191
-                  ->getResult();
190
+                    ->setParameters($parameters)
191
+                    ->getResult();
192 192
 
193 193
         self::assertSame(
194 194
             \array_values($parameters),
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
     public function testGetSingleResultThrowsExceptionOnNoResult() : void
333 333
     {
334 334
         $this->em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a')
335
-             ->getSingleResult();
335
+                ->getSingleResult();
336 336
     }
337 337
 
338 338
     /**
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
     public function testGetSingleScalarResultThrowsExceptionOnNoResult() : void
342 342
     {
343 343
         $this->em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a')
344
-             ->getSingleScalarResult();
344
+                ->getSingleScalarResult();
345 345
     }
346 346
 
347 347
     /**
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
         $this->em->clear();
373 373
 
374 374
         $this->em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a')
375
-             ->getSingleScalarResult();
375
+                ->getSingleScalarResult();
376 376
     }
377 377
 
378 378
     public function testModifiedLimitQuery() : void
@@ -389,27 +389,27 @@  discard block
 block discarded – undo
389 389
         $this->em->clear();
390 390
 
391 391
         $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
392
-                  ->setFirstResult(1)
393
-                  ->setMaxResults(2)
394
-                  ->getResult();
392
+                    ->setFirstResult(1)
393
+                    ->setMaxResults(2)
394
+                    ->getResult();
395 395
 
396 396
         self::assertCount(2, $data);
397 397
         self::assertEquals('gblanco1', $data[0]->username);
398 398
         self::assertEquals('gblanco2', $data[1]->username);
399 399
 
400 400
         $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
401
-                  ->setFirstResult(3)
402
-                  ->setMaxResults(2)
403
-                  ->getResult();
401
+                    ->setFirstResult(3)
402
+                    ->setMaxResults(2)
403
+                    ->getResult();
404 404
 
405 405
         self::assertCount(2, $data);
406 406
         self::assertEquals('gblanco3', $data[0]->username);
407 407
         self::assertEquals('gblanco4', $data[1]->username);
408 408
 
409 409
         $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u')
410
-                  ->setFirstResult(3)
411
-                  ->setMaxResults(2)
412
-                  ->getScalarResult();
410
+                    ->setFirstResult(3)
411
+                    ->setMaxResults(2)
412
+                    ->getScalarResult();
413 413
     }
414 414
 
415 415
     /**
@@ -620,9 +620,9 @@  discard block
 block discarded – undo
620 620
     {
621 621
         $qb = $this->em->createQueryBuilder();
622 622
         $qb->select('u')
623
-           ->from(CmsUser::class, 'u')
624
-           ->innerJoin('u.articles', 'a')
625
-           ->where('(u.id = 0) OR (u.id IS NULL)');
623
+            ->from(CmsUser::class, 'u')
624
+            ->innerJoin('u.articles', 'a')
625
+            ->where('(u.id = 0) OR (u.id IS NULL)');
626 626
 
627 627
         $query = $qb->getQuery();
628 628
         $users = $query->execute();
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     protected function setUp() : void
26 26
     {
27
-        if (! \class_exists('GearmanClient', false)) {
27
+        if ( ! \class_exists('GearmanClient', false)) {
28 28
             $this->markTestSkipped('pecl/gearman is required for this test to run.');
29 29
         }
30 30
 
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 
142 142
         self::assertTrue(
143 143
             $this->maxRunTime > $forTime,
144
-            'Because of locking this tests should have run at least ' . $forTime . ' seconds, ' .
145
-            'but only did for ' . $this->maxRunTime . ' seconds.'
144
+            'Because of locking this tests should have run at least '.$forTime.' seconds, '.
145
+            'but only did for '.$this->maxRunTime.' seconds.'
146 146
         );
147 147
         self::assertTrue(
148 148
             $this->maxRunTime < $notLongerThan,
149
-            'The longest task should not run longer than ' . $notLongerThan . ' seconds, ' .
150
-            'but did for ' . $this->maxRunTime . ' seconds.'
149
+            'The longest task should not run longer than '.$notLongerThan.' seconds, '.
150
+            'but did for '.$this->maxRunTime.' seconds.'
151 151
         );
152 152
     }
153 153
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         while ($worker->work()) {
38 38
             if ($worker->returnCode() !== GEARMAN_SUCCESS) {
39
-                echo 'return_code: ' . $worker->returnCode() . "\n";
39
+                echo 'return_code: '.$worker->returnCode()."\n";
40 40
                 break;
41 41
             }
42 42
         }
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function findWithLock($job)
63 63
     {
64
-        return $this->process($job, static function ($fixture, $em) {
64
+        return $this->process($job, static function($fixture, $em) {
65 65
             $entity = $em->find($fixture['entityName'], $fixture['entityId'], $fixture['lockMode']);
66 66
         });
67 67
     }
68 68
 
69 69
     public function dqlWithLock($job)
70 70
     {
71
-        return $this->process($job, static function ($fixture, $em) {
71
+        return $this->process($job, static function($fixture, $em) {
72 72
             /** @var Doctrine\ORM\Query $query */
73 73
             $query = $em->createQuery($fixture['dql']);
74 74
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
     public function lock($job)
82 82
     {
83
-        return $this->process($job, static function ($fixture, $em) {
83
+        return $this->process($job, static function($fixture, $em) {
84 84
             $entity = $em->find($fixture['entityName'], $fixture['entityId']);
85 85
 
86 86
             $em->lock($entity, $fixture['lockMode']);
@@ -89,18 +89,18 @@  discard block
 block discarded – undo
89 89
 
90 90
     protected function processWorkload($job)
91 91
     {
92
-        echo 'Received job: ' . $job->handle() . ' for function ' . $job->functionName() . "\n";
92
+        echo 'Received job: '.$job->handle().' for function '.$job->functionName()."\n";
93 93
 
94 94
         $workload = $job->workload();
95 95
         $workload = \unserialize($workload);
96 96
 
97
-        if (! isset($workload['conn']) || ! \is_array($workload['conn'])) {
97
+        if ( ! isset($workload['conn']) || ! \is_array($workload['conn'])) {
98 98
             throw new InvalidArgumentException('Missing Database parameters');
99 99
         }
100 100
 
101 101
         $this->em = $this->createEntityManager($workload['conn']);
102 102
 
103
-        if (! isset($workload['fixture'])) {
103
+        if ( ! isset($workload['fixture'])) {
104 104
             throw new InvalidArgumentException('Missing Fixture parameters');
105 105
         }
106 106
 
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
     protected function createEntityManager($conn)
111 111
     {
112 112
         $config = new Configuration();
113
-        $config->setProxyDir(__DIR__ . '/../../../Proxies');
113
+        $config->setProxyDir(__DIR__.'/../../../Proxies');
114 114
         $config->setProxyNamespace('MyProject\Proxies');
115 115
         $config->setAutoGenerateProxyClasses(true);
116 116
 
117
-        $annotDriver = $config->newDefaultAnnotationDriver([__DIR__ . '/../../../Models/']);
117
+        $annotDriver = $config->newDefaultAnnotationDriver([__DIR__.'/../../../Models/']);
118 118
         $config->setMetadataDriverImpl($annotDriver);
119 119
 
120 120
         $cache = new ArrayCache();
Please login to merge, or discard this patch.