@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | parent::setUp(); |
22 | 22 | |
23 | 23 | if ($this->em->getConnection()->getDatabasePlatform()->getName() !== 'postgresql') { |
24 | - $this->markTestSkipped('The ' . self::class . ' requires the use of postgresql.'); |
|
24 | + $this->markTestSkipped('The '.self::class.' requires the use of postgresql.'); |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $tool->createSchema($classes); |
133 | 133 | |
134 | 134 | $sql = $tool->getUpdateSchemaSql($classes); |
135 | - $sql = array_filter($sql, static function ($sql) { |
|
135 | + $sql = array_filter($sql, static function($sql) { |
|
136 | 136 | return strpos($sql, 'DROP SEQUENCE stonewood.') === 0; |
137 | 137 | }); |
138 | 138 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | parent::setUp(); |
17 | 17 | if ($this->em->getConnection()->getDatabasePlatform()->getName() !== 'mysql') { |
18 | - $this->markTestSkipped('The ' . self::class . ' requires the use of mysql.'); |
|
18 | + $this->markTestSkipped('The '.self::class.' requires the use of mysql.'); |
|
19 | 19 | } |
20 | 20 | } |
21 | 21 |
@@ -805,7 +805,7 @@ |
||
805 | 805 | $this->secondLevelCacheLogger->clearStats(); |
806 | 806 | $this->em->clear(); |
807 | 807 | |
808 | - $getHash = static function (AbstractQuery $query) { |
|
808 | + $getHash = static function(AbstractQuery $query) { |
|
809 | 809 | $method = new ReflectionMethod($query, 'getHash'); |
810 | 810 | $method->setAccessible(true); |
811 | 811 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | use Doctrine\Tests\Models\CMS\CmsUser; |
13 | 13 | use Doctrine\Tests\OrmFunctionalTestCase; |
14 | 14 | |
15 | -require_once __DIR__ . '/../../TestInit.php'; |
|
15 | +require_once __DIR__.'/../../TestInit.php'; |
|
16 | 16 | |
17 | 17 | class CustomFunctionsTest extends OrmFunctionalTestCase |
18 | 18 | { |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $this->em->flush(); |
33 | 33 | |
34 | 34 | // Instead of defining the function with the class name, we use a callback |
35 | - $this->em->getConfiguration()->addCustomStringFunction('FOO', static function ($funcName) { |
|
35 | + $this->em->getConfiguration()->addCustomStringFunction('FOO', static function($funcName) { |
|
36 | 36 | return new NoOp($funcName); |
37 | 37 | }); |
38 | - $this->em->getConfiguration()->addCustomNumericFunction('BAR', static function ($funcName) { |
|
38 | + $this->em->getConfiguration()->addCustomNumericFunction('BAR', static function($funcName) { |
|
39 | 39 | return new NoOp($funcName); |
40 | 40 | }); |
41 | 41 |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | { |
204 | 204 | $listener = new ListenerSecondLevelCacheTest( |
205 | 205 | [ |
206 | - Events::postFlush => static function () { |
|
206 | + Events::postFlush => static function() { |
|
207 | 207 | throw new RuntimeException('post flush failure'); |
208 | 208 | }, |
209 | 209 | ] |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | $listener = new ListenerSecondLevelCacheTest( |
237 | 237 | [ |
238 | - Events::postUpdate => static function () { |
|
238 | + Events::postUpdate => static function() { |
|
239 | 239 | throw new RuntimeException('post update failure'); |
240 | 240 | }, |
241 | 241 | ] |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | self::assertInstanceOf(State::class, $state); |
255 | 255 | self::assertEquals($stateName, $state->getName()); |
256 | 256 | |
257 | - $state->setName($stateName . uniqid()); |
|
257 | + $state->setName($stateName.uniqid()); |
|
258 | 258 | |
259 | 259 | $this->em->persist($state); |
260 | 260 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $this->em->clear(); |
282 | 282 | |
283 | 283 | $listener = new ListenerSecondLevelCacheTest([ |
284 | - Events::postRemove => static function () { |
|
284 | + Events::postRemove => static function() { |
|
285 | 285 | throw new RuntimeException('post remove failure'); |
286 | 286 | }, |
287 | 287 | ]); |
@@ -90,7 +90,7 @@ |
||
90 | 90 | |
91 | 91 | public function assertLoadingOfOwningSide($products) |
92 | 92 | { |
93 | - [$firstProduct, $secondProduct] = $products; |
|
93 | + [$firstProduct, $secondProduct] = $products; |
|
94 | 94 | self::assertCount(2, $firstProduct->getRelated()); |
95 | 95 | self::assertCount(2, $secondProduct->getRelated()); |
96 | 96 |
@@ -36,7 +36,7 @@ discard block |
||
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 |
||
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 | $query->setLockMode($fixture['lockMode']); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | public function lock($job) |
81 | 81 | { |
82 | - return $this->process($job, static function ($fixture, $em) { |
|
82 | + return $this->process($job, static function($fixture, $em) { |
|
83 | 83 | $entity = $em->find($fixture['entityName'], $fixture['entityId']); |
84 | 84 | $em->lock($entity, $fixture['lockMode']); |
85 | 85 | }); |
@@ -87,18 +87,18 @@ discard block |
||
87 | 87 | |
88 | 88 | protected function processWorkload($job) |
89 | 89 | { |
90 | - echo 'Received job: ' . $job->handle() . ' for function ' . $job->functionName() . "\n"; |
|
90 | + echo 'Received job: '.$job->handle().' for function '.$job->functionName()."\n"; |
|
91 | 91 | |
92 | 92 | $workload = $job->workload(); |
93 | 93 | $workload = unserialize($workload); |
94 | 94 | |
95 | - if (! isset($workload['conn']) || ! is_array($workload['conn'])) { |
|
95 | + if ( ! isset($workload['conn']) || ! is_array($workload['conn'])) { |
|
96 | 96 | throw new InvalidArgumentException('Missing Database parameters'); |
97 | 97 | } |
98 | 98 | |
99 | 99 | $this->em = $this->createEntityManager($workload['conn']); |
100 | 100 | |
101 | - if (! isset($workload['fixture'])) { |
|
101 | + if ( ! isset($workload['fixture'])) { |
|
102 | 102 | throw new InvalidArgumentException('Missing Fixture parameters'); |
103 | 103 | } |
104 | 104 | return $workload['fixture']; |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | protected function createEntityManager($conn) |
108 | 108 | { |
109 | 109 | $config = new Configuration(); |
110 | - $config->setProxyDir(__DIR__ . '/../../../Proxies'); |
|
110 | + $config->setProxyDir(__DIR__.'/../../../Proxies'); |
|
111 | 111 | $config->setProxyNamespace('MyProject\Proxies'); |
112 | 112 | $config->setAutoGenerateProxyClasses(true); |
113 | 113 | |
114 | - $annotDriver = $config->newDefaultAnnotationDriver([__DIR__ . '/../../../Models/']); |
|
114 | + $annotDriver = $config->newDefaultAnnotationDriver([__DIR__.'/../../../Models/']); |
|
115 | 115 | $config->setMetadataDriverImpl($annotDriver); |
116 | 116 | |
117 | 117 | $cache = new ArrayCache(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $article = new CmsArticle(); |
93 | 93 | |
94 | 94 | $this->expectException(InvalidArgumentException::class); |
95 | - $this->expectExceptionMessage('Entity ' . CmsArticle::class); |
|
95 | + $this->expectExceptionMessage('Entity '.CmsArticle::class); |
|
96 | 96 | |
97 | 97 | $this->em->lock($article, LockMode::OPTIMISTIC, $article->version + 1); |
98 | 98 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | { |
142 | 142 | $writeLockSql = $this->em->getConnection()->getDatabasePlatform()->getWriteLockSQL(); |
143 | 143 | |
144 | - if (! $writeLockSql) { |
|
144 | + if ( ! $writeLockSql) { |
|
145 | 145 | $this->markTestSkipped('Database Driver has no Write Lock support.'); |
146 | 146 | } |
147 | 147 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | $readLockSql = $this->em->getConnection()->getDatabasePlatform()->getReadLockSQL(); |
178 | 178 | |
179 | - if (! $readLockSql) { |
|
179 | + if ( ! $readLockSql) { |
|
180 | 180 | $this->markTestSkipped('Database Driver has no Write Lock support.'); |
181 | 181 | } |
182 | 182 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function testLockOptimisticNonVersionedThrowsExceptionInDQL() : void |
211 | 211 | { |
212 | - $dql = 'SELECT u FROM ' . CmsUser::class . " u WHERE u.username = 'gblanco'"; |
|
212 | + $dql = 'SELECT u FROM '.CmsUser::class." u WHERE u.username = 'gblanco'"; |
|
213 | 213 | |
214 | 214 | $this->expectException(OptimisticLockException::class); |
215 | 215 | $this->expectExceptionMessage('The optimistic lock on an entity failed.'); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $this->em->flush(); |
115 | 115 | $this->em->clear(); |
116 | 116 | |
117 | - $dql = 'SELECT p FROM ' . __NAMESPACE__ . '\DDC93Person p'; |
|
117 | + $dql = 'SELECT p FROM '.__NAMESPACE__.'\DDC93Person p'; |
|
118 | 118 | $persons = $this->em->createQuery($dql)->getResult(); |
119 | 119 | |
120 | 120 | self::assertCount(3, $persons); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | self::assertEquals('United States of America', $person->address->country->name); |
128 | 128 | } |
129 | 129 | |
130 | - $dql = 'SELECT p FROM ' . __NAMESPACE__ . '\DDC93Person p'; |
|
130 | + $dql = 'SELECT p FROM '.__NAMESPACE__.'\DDC93Person p'; |
|
131 | 131 | $persons = $this->em->createQuery($dql)->getArrayResult(); |
132 | 132 | |
133 | 133 | foreach ($persons as $person) { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $this->em->flush(); |
153 | 153 | |
154 | 154 | // SELECT |
155 | - $selectDql = 'SELECT p FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country'; |
|
155 | + $selectDql = 'SELECT p FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country'; |
|
156 | 156 | $loadedPerson = $this->em->createQuery($selectDql) |
157 | 157 | ->setParameter('city', 'Karlsruhe') |
158 | 158 | ->setParameter('country', 'Germany') |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | ); |
168 | 168 | |
169 | 169 | // UPDATE |
170 | - $updateDql = 'UPDATE ' . __NAMESPACE__ . '\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city'; |
|
170 | + $updateDql = 'UPDATE '.__NAMESPACE__.'\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city'; |
|
171 | 171 | $this->em->createQuery($updateDql) |
172 | 172 | ->setParameter('street', 'Boo') |
173 | 173 | ->setParameter('country', 'DE') |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | self::assertEquals('DE', $person->address->country->name); |
180 | 180 | |
181 | 181 | // DELETE |
182 | - $this->em->createQuery('DELETE ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country') |
|
182 | + $this->em->createQuery('DELETE '.__NAMESPACE__.'\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country') |
|
183 | 183 | ->setParameter('city', 'Karlsruhe') |
184 | 184 | ->setParameter('country', 'DE') |
185 | 185 | ->execute(); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $this->em->clear(); |
197 | 197 | |
198 | 198 | // Prove that the entity was persisted correctly. |
199 | - $dql = 'SELECT p FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.name = :name'; |
|
199 | + $dql = 'SELECT p FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.name = :name'; |
|
200 | 200 | |
201 | 201 | $person = $this->em->createQuery($dql) |
202 | 202 | ->setParameter('name', 'Karl') |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | // Clear the EM and prove that the embeddable can be the subject of a partial query. |
211 | 211 | $this->em->clear(); |
212 | 212 | |
213 | - $dql = 'SELECT PARTIAL p.{id,address.city} FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.name = :name'; |
|
213 | + $dql = 'SELECT PARTIAL p.{id,address.city} FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.name = :name'; |
|
214 | 214 | |
215 | 215 | $person = $this->em->createQuery($dql) |
216 | 216 | ->setParameter('name', 'Karl') |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | // Clear the EM and prove that the embeddable can be the subject of a partial query regardless of attributes positions. |
227 | 227 | $this->em->clear(); |
228 | 228 | |
229 | - $dql = 'SELECT PARTIAL p.{address.city, id} FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.name = :name'; |
|
229 | + $dql = 'SELECT PARTIAL p.{address.city, id} FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.name = :name'; |
|
230 | 230 | |
231 | 231 | $person = $this->em->createQuery($dql) |
232 | 232 | ->setParameter('name', 'Karl') |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $this->expectException(QueryException::class); |
246 | 246 | $this->expectExceptionMessage('no field or association named address.asdfasdf'); |
247 | 247 | |
248 | - $this->em->createQuery('SELECT p FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.address.asdfasdf IS NULL') |
|
248 | + $this->em->createQuery('SELECT p FROM '.__NAMESPACE__.'\\DDC93Person p WHERE p.address.asdfasdf IS NULL') |
|
249 | 249 | ->execute(); |
250 | 250 | } |
251 | 251 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $this->expectException(QueryException::class); |
255 | 255 | $this->expectExceptionMessage("no mapped field named 'address.asdfasdf'"); |
256 | 256 | |
257 | - $this->em->createQuery('SELECT PARTIAL p.{id,address.asdfasdf} FROM ' . __NAMESPACE__ . '\\DDC93Person p') |
|
257 | + $this->em->createQuery('SELECT PARTIAL p.{id,address.asdfasdf} FROM '.__NAMESPACE__.'\\DDC93Person p') |
|
258 | 258 | ->execute(); |
259 | 259 | } |
260 | 260 | |
@@ -316,15 +316,15 @@ discard block |
||
316 | 316 | $this->expectException(MappingException::class); |
317 | 317 | $this->expectExceptionMessage( |
318 | 318 | sprintf( |
319 | - 'Infinite nesting detected for embedded property %s::nested. ' . |
|
319 | + 'Infinite nesting detected for embedded property %s::nested. '. |
|
320 | 320 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
321 | - __NAMESPACE__ . '\\' . $declaredEmbeddableClassName |
|
321 | + __NAMESPACE__.'\\'.$declaredEmbeddableClassName |
|
322 | 322 | ) |
323 | 323 | ); |
324 | 324 | |
325 | 325 | $this->schemaTool->createSchema( |
326 | 326 | [ |
327 | - $this->em->getClassMetadata(__NAMESPACE__ . '\\' . $embeddableClassName), |
|
327 | + $this->em->getClassMetadata(__NAMESPACE__.'\\'.$embeddableClassName), |
|
328 | 328 | ] |
329 | 329 | ); |
330 | 330 | } |