@@ -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 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function setMaxRunningTime($maxRunningTime) |
| 43 | 43 | { |
| 44 | - if (! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
| 44 | + if ( ! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
| 45 | 45 | throw new \InvalidArgumentException(); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -14,20 +14,20 @@ |
||
| 14 | 14 | error_reporting(E_ALL | E_STRICT); |
| 15 | 15 | date_default_timezone_set('UTC'); |
| 16 | 16 | |
| 17 | -if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { |
|
| 17 | +if (file_exists(__DIR__.'/../../../vendor/autoload.php')) { |
|
| 18 | 18 | // dependencies were installed via composer - this is the main project |
| 19 | - require __DIR__ . '/../../../vendor/autoload.php'; |
|
| 20 | -} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) { |
|
| 19 | + require __DIR__.'/../../../vendor/autoload.php'; |
|
| 20 | +} elseif (file_exists(__DIR__.'/../../../../../autoload.php')) { |
|
| 21 | 21 | // installed as a dependency in `vendor` |
| 22 | - require __DIR__ . '/../../../../../autoload.php'; |
|
| 22 | + require __DIR__.'/../../../../../autoload.php'; |
|
| 23 | 23 | } else { |
| 24 | 24 | throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?'); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | -if (! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) { |
|
| 28 | - throw new \Exception('Could not create ' . __DIR__ . '/Proxies Folder.'); |
|
| 27 | +if ( ! file_exists(__DIR__.'/Proxies') && ! mkdir(__DIR__.'/Proxies')) { |
|
| 28 | + throw new \Exception('Could not create '.__DIR__.'/Proxies Folder.'); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | -if (! file_exists(__DIR__ . '/ORM/Proxy/generated') && ! mkdir(__DIR__ . '/ORM/Proxy/generated')) { |
|
| 32 | - throw new \Exception('Could not create ' . __DIR__ . '/ORM/Proxy/generated Folder.'); |
|
| 31 | +if ( ! file_exists(__DIR__.'/ORM/Proxy/generated') && ! mkdir(__DIR__.'/ORM/Proxy/generated')) { |
|
| 32 | + throw new \Exception('Could not create '.__DIR__.'/ORM/Proxy/generated Folder.'); |
|
| 33 | 33 | } |
@@ -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); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | protected function createRegion() |
| 60 | 60 | { |
| 61 | - $this->directory = sys_get_temp_dir() . '/doctrine_lock_' . uniqid(); |
|
| 61 | + $this->directory = sys_get_temp_dir().'/doctrine_lock_'.uniqid(); |
|
| 62 | 62 | |
| 63 | 63 | $region = new DefaultRegion('concurren_region_test', $this->cache); |
| 64 | 64 | |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | $reflectionDirectory->setAccessible(true); |
| 262 | 262 | $reflectionDirectory->setValue($region, str_repeat('a', 10000)); |
| 263 | 263 | |
| 264 | - set_error_handler(function () { |
|
| 264 | + set_error_handler(function() { |
|
| 265 | 265 | }, E_WARNING); |
| 266 | 266 | self::assertTrue($region->evictAll()); |
| 267 | 267 | restore_error_handler(); |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | { |
| 275 | 275 | $path = $path ?: $this->directory; |
| 276 | 276 | |
| 277 | - if (! is_dir($path)) { |
|
| 277 | + if ( ! is_dir($path)) { |
|
| 278 | 278 | return; |
| 279 | 279 | } |
| 280 | 280 | |
@@ -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(); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function testIssue2059() : void |
| 31 | 31 | { |
| 32 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 32 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 33 | 33 | $this->markTestSkipped('Platform does not support foreign keys.'); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function testLoadMetadataFromDatabase() : void |
| 53 | 53 | { |
| 54 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 54 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 55 | 55 | $this->markTestSkipped('Platform does not support foreign keys.'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | public function testLoadMetadataWithForeignKeyFromDatabase() : void |
| 91 | 91 | { |
| 92 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 92 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 93 | 93 | $this->markTestSkipped('Platform does not support foreign keys.'); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | public function testDetectManyToManyTables() : void |
| 124 | 124 | { |
| 125 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 125 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 126 | 126 | $this->markTestSkipped('Platform does not support foreign keys.'); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | public function testLoadMetadataFromDatabaseDetail() : void |
| 164 | 164 | { |
| 165 | - if (! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 165 | + if ( ! $this->em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
| 166 | 166 | $this->markTestSkipped('Platform does not support foreign keys.'); |
| 167 | 167 | } |
| 168 | 168 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | // FIXME: Condition here is fugly. |
| 203 | 203 | // NOTE: PostgreSQL and SQL SERVER do not support UNSIGNED integer |
| 204 | - if (! $this->em->getConnection()->getDatabasePlatform() instanceof PostgreSqlPlatform && |
|
| 204 | + if ( ! $this->em->getConnection()->getDatabasePlatform() instanceof PostgreSqlPlatform && |
|
| 205 | 205 | ! $this->em->getConnection()->getDatabasePlatform() instanceof SQLServerPlatform) { |
| 206 | 206 | self::assertNotNull($metadata->getProperty('columnUnsigned')); |
| 207 | 207 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | self::assertNotEmpty($indexes['index1']['columns']); |
| 245 | 245 | self::assertEquals( |
| 246 | - ['column_index1','column_index2'], |
|
| 246 | + ['column_index1', 'column_index2'], |
|
| 247 | 247 | $indexes['index1']['columns'] |
| 248 | 248 | ); |
| 249 | 249 | |