@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | for ($i = 1; $i <= 10000; ++$i) { |
40 | 40 | $user = new CMS\CmsUser(); |
41 | 41 | $user->status = 'user'; |
42 | - $user->username = 'user' . $i; |
|
43 | - $user->name = 'Mr.Smith-' . $i; |
|
42 | + $user->username = 'user'.$i; |
|
43 | + $user->name = 'Mr.Smith-'.$i; |
|
44 | 44 | |
45 | 45 | $this->users[$i] = $user; |
46 | 46 | } |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | // Yes, this is a lot of overhead, but I have no better solution other than |
54 | 54 | // completely mocking out the DB, which would be silly (query impact is |
55 | 55 | // necessarily part of our benchmarks) |
56 | - $this->entityManager->getConnection()->executeQuery('DELETE FROM ' . $this->tableName)->execute(); |
|
56 | + $this->entityManager->getConnection()->executeQuery('DELETE FROM '.$this->tableName)->execute(); |
|
57 | 57 | |
58 | 58 | foreach ($this->users as $key => $user) { |
59 | 59 | $this->entityManager->persist($user); |
60 | 60 | |
61 | - if (! ($key % 20)) { |
|
61 | + if ( ! ($key % 20)) { |
|
62 | 62 | $this->entityManager->flush(); |
63 | 63 | $this->entityManager->clear(); |
64 | 64 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | 'u__status' => 'developer', |
64 | 64 | 'u__username' => 'jwage', |
65 | 65 | 'u__name' => 'Jonathan', |
66 | - 'sclr0' => 'JWAGE' . $i, |
|
66 | + 'sclr0' => 'JWAGE'.$i, |
|
67 | 67 | 'p__phonenumber' => '91', |
68 | 68 | ]; |
69 | 69 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | public function fetchColumn($columnNumber = 0) |
44 | 44 | { |
45 | 45 | $row = current($this->resultSet); |
46 | - if (! is_array($row)) { |
|
46 | + if ( ! is_array($row)) { |
|
47 | 47 | return false; |
48 | 48 | } |
49 | 49 | $val = array_shift($row); |
@@ -76,7 +76,7 @@ |
||
76 | 76 | if ($config === null) { |
77 | 77 | $config = new Configuration(); |
78 | 78 | |
79 | - $config->setProxyDir(__DIR__ . '/../Proxies'); |
|
79 | + $config->setProxyDir(__DIR__.'/../Proxies'); |
|
80 | 80 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
81 | 81 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver()); |
82 | 82 | } |
@@ -192,7 +192,7 @@ |
||
192 | 192 | |
193 | 193 | $this->throwException(__FUNCTION__); |
194 | 194 | |
195 | - if (! isset($this->locks[$key->hash])) { |
|
195 | + if ( ! isset($this->locks[$key->hash])) { |
|
196 | 196 | return; |
197 | 197 | } |
198 | 198 |
@@ -90,7 +90,7 @@ |
||
90 | 90 | { |
91 | 91 | $realDbParams = self::getParamsForMainConnection(); |
92 | 92 | |
93 | - if (! self::$initialized) { |
|
93 | + if ( ! self::$initialized) { |
|
94 | 94 | $tmpDbParams = self::getParamsForTemporaryConnection(); |
95 | 95 | |
96 | 96 | $realConn = DriverManager::getConnection($realDbParams); |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $uow->registerManaged($state, ['id' => $state->getId()], ['name' => $city->getName()]); |
391 | 391 | $uow->registerManaged($city, ['id' => $city->getId()], ['name' => $city->getName(), 'state' => $state]); |
392 | 392 | |
393 | - $this->region->addReturn('put', true); // put root entity |
|
393 | + $this->region->addReturn('put', true); // put root entity |
|
394 | 394 | $this->region->addReturn('put', false); // association fails |
395 | 395 | |
396 | 396 | self::assertFalse($this->queryCache->put($key, $rsm, $result)); |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | $uow->registerManaged($city2, ['id' => $city2->getId()], ['name' => $city2->getName(), 'state' => $state]); |
424 | 424 | $uow->registerManaged($state, ['id' => $state->getId()], ['name' => $state->getName(), 'cities' => $state->getCities()]); |
425 | 425 | |
426 | - $this->region->addReturn('put', true); // put root entity |
|
426 | + $this->region->addReturn('put', true); // put root entity |
|
427 | 427 | $this->region->addReturn('put', false); // collection association fails |
428 | 428 | |
429 | 429 | self::assertFalse($this->queryCache->put($key, $rsm, $result)); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $size = 500; |
140 | 140 | $startPersist = microtime(true); |
141 | 141 | |
142 | - echo PHP_EOL . $label; |
|
142 | + echo PHP_EOL.$label; |
|
143 | 143 | |
144 | 144 | for ($i = 0; $i < $size; $i++) { |
145 | 145 | $em->persist(new Country(sprintf('Country %d', $i))); |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | $startPersist = microtime(true); |
174 | 174 | $country = new Country('Country'); |
175 | 175 | |
176 | - echo PHP_EOL . $label; |
|
176 | + echo PHP_EOL.$label; |
|
177 | 177 | |
178 | 178 | $em->persist($country); |
179 | 179 | $em->flush(); |
180 | 180 | |
181 | 181 | for ($i = 0; $i < $size / 2; $i++) { |
182 | - $state = new State('State ' . $i, $country); |
|
182 | + $state = new State('State '.$i, $country); |
|
183 | 183 | |
184 | 184 | $em->persist($state); |
185 | 185 | |
@@ -228,10 +228,10 @@ discard block |
||
228 | 228 | $countries = []; |
229 | 229 | $startPersist = microtime(true); |
230 | 230 | |
231 | - echo PHP_EOL . $label; |
|
231 | + echo PHP_EOL.$label; |
|
232 | 232 | |
233 | 233 | for ($i = 0; $i < $size; $i++) { |
234 | - $country = new Country('Country ' . $i); |
|
234 | + $country = new Country('Country '.$i); |
|
235 | 235 | |
236 | 236 | $em->persist($country); |
237 | 237 | |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | $startPersist = microtime(true); |
264 | 264 | $rep = $em->getRepository(Country::class); |
265 | 265 | |
266 | - echo PHP_EOL . $label; |
|
266 | + echo PHP_EOL.$label; |
|
267 | 267 | |
268 | 268 | for ($i = 0; $i < $size; $i++) { |
269 | - $em->persist(new Country('Country ' . $i)); |
|
269 | + $em->persist(new Country('Country '.$i)); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | $em->flush(); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | |
307 | 307 | $queryCount = $this->getCurrentQueryCount(); |
308 | 308 | self::assertFalse($user->articles->contains($article)); |
309 | - self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), 'Checking for contains of persisted entity should cause one query to be executed.'); |
|
309 | + self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Checking for contains of persisted entity should cause one query to be executed.'); |
|
310 | 310 | self::assertFalse($user->articles->isInitialized(), 'Post-Condition: Collection is not initialized.'); |
311 | 311 | |
312 | 312 | // Test One to Many existence with state managed |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | |
474 | 474 | $queryCount = $this->getCurrentQueryCount(); |
475 | 475 | self::assertTrue($group->users->contains($user)); |
476 | - self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), 'Checking for contains of managed entity should cause one query to be executed.'); |
|
476 | + self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Checking for contains of managed entity should cause one query to be executed.'); |
|
477 | 477 | self::assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); |
478 | 478 | |
479 | 479 | $newUser = new CmsUser(); |