@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | $contracts = $this->em->createQuery('SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c ORDER BY c.id')->getScalarResult(); |
235 | 235 | |
236 | - $discrValues = array_map(function ($a) { |
|
236 | + $discrValues = array_map(function($a) { |
|
237 | 237 | return $a['c_discr']; |
238 | 238 | }, $contracts); |
239 | 239 | |
@@ -335,19 +335,19 @@ discard block |
||
335 | 335 | |
336 | 336 | $repos = $this->em->getRepository(CompanyContract::class); |
337 | 337 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
338 | - self::assertCount(3, $contracts, 'There should be 3 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyContract'"); |
|
338 | + self::assertCount(3, $contracts, 'There should be 3 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyContract'"); |
|
339 | 339 | |
340 | 340 | $repos = $this->em->getRepository(CompanyFixContract::class); |
341 | 341 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
342 | - self::assertCount(1, $contracts, 'There should be 1 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFixContract'"); |
|
342 | + self::assertCount(1, $contracts, 'There should be 1 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFixContract'"); |
|
343 | 343 | |
344 | 344 | $repos = $this->em->getRepository(CompanyFlexContract::class); |
345 | 345 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
346 | - self::assertCount(2, $contracts, 'There should be 2 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexContract'"); |
|
346 | + self::assertCount(2, $contracts, 'There should be 2 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFlexContract'"); |
|
347 | 347 | |
348 | 348 | $repos = $this->em->getRepository(CompanyFlexUltraContract::class); |
349 | 349 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
350 | - self::assertCount(1, $contracts, 'There should be 1 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexUltraContract'"); |
|
350 | + self::assertCount(1, $contracts, 'There should be 1 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFlexUltraContract'"); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | protected function setUp() : void |
25 | 25 | { |
26 | - if (! class_exists('GearmanClient', false)) { |
|
26 | + if ( ! class_exists('GearmanClient', false)) { |
|
27 | 27 | $this->markTestSkipped('pecl/gearman is required for this test to run.'); |
28 | 28 | } |
29 | 29 | |
@@ -140,13 +140,13 @@ discard block |
||
140 | 140 | |
141 | 141 | self::assertTrue( |
142 | 142 | $this->maxRunTime > $forTime, |
143 | - 'Because of locking this tests should have run at least ' . $forTime . ' seconds, ' . |
|
144 | - 'but only did for ' . $this->maxRunTime . ' seconds.' |
|
143 | + 'Because of locking this tests should have run at least '.$forTime.' seconds, '. |
|
144 | + 'but only did for '.$this->maxRunTime.' seconds.' |
|
145 | 145 | ); |
146 | 146 | self::assertTrue( |
147 | 147 | $this->maxRunTime < $notLongerThan, |
148 | - 'The longest task should not run longer than ' . $notLongerThan . ' seconds, ' . |
|
149 | - 'but did for ' . $this->maxRunTime . ' seconds.' |
|
148 | + 'The longest task should not run longer than '.$notLongerThan.' seconds, '. |
|
149 | + 'but did for '.$this->maxRunTime.' seconds.' |
|
150 | 150 | ); |
151 | 151 | } |
152 | 152 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $test = new OptimisticStandard(); |
121 | 121 | |
122 | 122 | for ($i = 0; $i < 5; $i++) { |
123 | - $test->name = 'test' . $i; |
|
123 | + $test->name = 'test'.$i; |
|
124 | 124 | |
125 | 125 | $this->em->persist($test); |
126 | 126 | $this->em->flush(); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $caughtException = null; |
253 | 253 | |
254 | 254 | try { |
255 | - $expectedVersionExpired = DateTime::createFromFormat('U', (string) ($test->version->getTimestamp()-3600)); |
|
255 | + $expectedVersionExpired = DateTime::createFromFormat('U', (string) ($test->version->getTimestamp() - 3600)); |
|
256 | 256 | |
257 | 257 | $this->em->lock($test, LockMode::OPTIMISTIC, $expectedVersionExpired); |
258 | 258 | } catch (OptimisticLockException $e) { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | while ($worker->work()) { |
35 | 35 | if ($worker->returnCode() !== GEARMAN_SUCCESS) { |
36 | - echo 'return_code: ' . $worker->returnCode() . "\n"; |
|
36 | + echo 'return_code: '.$worker->returnCode()."\n"; |
|
37 | 37 | break; |
38 | 38 | } |
39 | 39 | } |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | |
59 | 59 | public function findWithLock($job) |
60 | 60 | { |
61 | - return $this->process($job, function ($fixture, $em) { |
|
61 | + return $this->process($job, function($fixture, $em) { |
|
62 | 62 | $entity = $em->find($fixture['entityName'], $fixture['entityId'], $fixture['lockMode']); |
63 | 63 | }); |
64 | 64 | } |
65 | 65 | |
66 | 66 | public function dqlWithLock($job) |
67 | 67 | { |
68 | - return $this->process($job, function ($fixture, $em) { |
|
68 | + return $this->process($job, function($fixture, $em) { |
|
69 | 69 | /** @var Doctrine\ORM\Query $query */ |
70 | 70 | $query = $em->createQuery($fixture['dql']); |
71 | 71 | $query->setLockMode($fixture['lockMode']); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | public function lock($job) |
78 | 78 | { |
79 | - return $this->process($job, function ($fixture, $em) { |
|
79 | + return $this->process($job, function($fixture, $em) { |
|
80 | 80 | $entity = $em->find($fixture['entityName'], $fixture['entityId']); |
81 | 81 | $em->lock($entity, $fixture['lockMode']); |
82 | 82 | }); |
@@ -84,18 +84,18 @@ discard block |
||
84 | 84 | |
85 | 85 | protected function processWorkload($job) |
86 | 86 | { |
87 | - echo 'Received job: ' . $job->handle() . ' for function ' . $job->functionName() . "\n"; |
|
87 | + echo 'Received job: '.$job->handle().' for function '.$job->functionName()."\n"; |
|
88 | 88 | |
89 | 89 | $workload = $job->workload(); |
90 | 90 | $workload = unserialize($workload); |
91 | 91 | |
92 | - if (! isset($workload['conn']) || ! is_array($workload['conn'])) { |
|
92 | + if ( ! isset($workload['conn']) || ! is_array($workload['conn'])) { |
|
93 | 93 | throw new \InvalidArgumentException('Missing Database parameters'); |
94 | 94 | } |
95 | 95 | |
96 | 96 | $this->em = $this->createEntityManager($workload['conn']); |
97 | 97 | |
98 | - if (! isset($workload['fixture'])) { |
|
98 | + if ( ! isset($workload['fixture'])) { |
|
99 | 99 | throw new \InvalidArgumentException('Missing Fixture parameters'); |
100 | 100 | } |
101 | 101 | return $workload['fixture']; |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | protected function createEntityManager($conn) |
105 | 105 | { |
106 | 106 | $config = new Configuration(); |
107 | - $config->setProxyDir(__DIR__ . '/../../../Proxies'); |
|
107 | + $config->setProxyDir(__DIR__.'/../../../Proxies'); |
|
108 | 108 | $config->setProxyNamespace('MyProject\Proxies'); |
109 | 109 | $config->setAutoGenerateProxyClasses(true); |
110 | 110 | |
111 | - $annotDriver = $config->newDefaultAnnotationDriver([__DIR__ . '/../../../Models/']); |
|
111 | + $annotDriver = $config->newDefaultAnnotationDriver([__DIR__.'/../../../Models/']); |
|
112 | 112 | $config->setMetadataDriverImpl($annotDriver); |
113 | 113 | |
114 | 114 | $cache = new ArrayCache(); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | |
24 | 24 | public function testIssue() : void |
25 | 25 | { |
26 | - $q = $this->em->createQuery('select u, c.data from ' . __NAMESPACE__ . '\\DDC493Distributor u JOIN u.contact c'); |
|
26 | + $q = $this->em->createQuery('select u, c.data from '.__NAMESPACE__.'\\DDC493Distributor u JOIN u.contact c'); |
|
27 | 27 | |
28 | 28 | self::assertSQLEquals( |
29 | 29 | 'SELECT t0."id" AS c0, t1."data" AS c1, t0."discr" AS c2, t0."contact" AS c3 FROM "DDC493Distributor" t2 INNER JOIN "DDC493Customer" t0 ON t2."id" = t0."id" INNER JOIN "DDC493Contact" t1 ON t0."contact" = t1."id"', |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | public function testIssue() : Query |
26 | 26 | { |
27 | - $dql = 'SELECT e FROM ' . __NAMESPACE__ . '\DDC2224Entity e WHERE e.field = :field'; |
|
27 | + $dql = 'SELECT e FROM '.__NAMESPACE__.'\DDC2224Entity e WHERE e.field = :field'; |
|
28 | 28 | $query = $this->em->createQuery($dql); |
29 | 29 | $query->setQueryCacheDriver(new ArrayCache()); |
30 | 30 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $this->em->flush(); |
58 | 58 | $this->em->clear(); |
59 | 59 | |
60 | - $dql = 'SELECT a, b, ba, c FROM ' . __NAMESPACE__ . '\DDC1514EntityA AS a LEFT JOIN a.entitiesB AS b LEFT JOIN b.entityATo AS ba LEFT JOIN a.entityC AS c ORDER BY a.title'; |
|
60 | + $dql = 'SELECT a, b, ba, c FROM '.__NAMESPACE__.'\DDC1514EntityA AS a LEFT JOIN a.entitiesB AS b LEFT JOIN b.entityATo AS ba LEFT JOIN a.entityC AS c ORDER BY a.title'; |
|
61 | 61 | $results = $this->em->createQuery($dql)->getResult(); |
62 | 62 | |
63 | 63 | self::assertEquals($a1->id, $results[0]->id); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $this->em->flush(); |
52 | 52 | $this->em->clear(); |
53 | 53 | |
54 | - $dql = 'SELECT a, b, ba FROM ' . __NAMESPACE__ . '\DDC1452EntityA AS a LEFT JOIN a.entitiesB AS b LEFT JOIN b.entityATo AS ba'; |
|
54 | + $dql = 'SELECT a, b, ba FROM '.__NAMESPACE__.'\DDC1452EntityA AS a LEFT JOIN a.entitiesB AS b LEFT JOIN b.entityATo AS ba'; |
|
55 | 55 | $results = $this->em->createQuery($dql)->setMaxResults(1)->getResult(); |
56 | 56 | |
57 | 57 | self::assertSame($results[0], $results[0]->entitiesB[0]->entityAFrom); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | |
24 | 24 | public function testIssue() : void |
25 | 25 | { |
26 | - $q = $this->em->createQuery('select u from ' . __NAMESPACE__ . '\\DDC513OfferItem u left join u.price p'); |
|
26 | + $q = $this->em->createQuery('select u from '.__NAMESPACE__.'\\DDC513OfferItem u left join u.price p'); |
|
27 | 27 | |
28 | 28 | self::assertSQLEquals( |
29 | 29 | 'SELECT t0."id" AS c0, t0."discr" AS c1, t0."price" AS c2 FROM "DDC513OfferItem" t1 INNER JOIN "DDC513Item" t0 ON t1."id" = t0."id" LEFT JOIN "DDC513Price" t2 ON t0."price" = t2."id"', |