@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\Models\Quote; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests; |
| 6 | 6 | |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | $conn = static::$sharedConn; |
| 335 | 335 | |
| 336 | 336 | // In case test is skipped, tearDown is called, but no setup may have run |
| 337 | - if (! $conn) { |
|
| 337 | + if ( ! $conn) { |
|
| 338 | 338 | return; |
| 339 | 339 | } |
| 340 | 340 | |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | if (isset($this->usedModelSets['directorytree'])) { |
| 411 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('file')); |
|
| 411 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('file')); |
|
| 412 | 412 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
| 413 | 413 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
| 414 | 414 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -501,12 +501,12 @@ discard block |
||
| 501 | 501 | ) |
| 502 | 502 | ); |
| 503 | 503 | |
| 504 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
| 505 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-group')); |
|
| 506 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-phone')); |
|
| 507 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-user')); |
|
| 508 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-address')); |
|
| 509 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
| 504 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
| 505 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-group')); |
|
| 506 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-phone')); |
|
| 507 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-user')); |
|
| 508 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-address')); |
|
| 509 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | $classes = []; |
| 620 | 620 | |
| 621 | 621 | foreach ($classNames as $className) { |
| 622 | - if (! isset(static::$entityTablesCreated[$className])) { |
|
| 622 | + if ( ! isset(static::$entityTablesCreated[$className])) { |
|
| 623 | 623 | static::$entityTablesCreated[$className] = true; |
| 624 | 624 | $classes[] = $this->em->getClassMetadata($className); |
| 625 | 625 | } |
@@ -639,25 +639,25 @@ discard block |
||
| 639 | 639 | { |
| 640 | 640 | $this->setUpDBALTypes(); |
| 641 | 641 | |
| 642 | - if (! isset(static::$sharedConn)) { |
|
| 642 | + if ( ! isset(static::$sharedConn)) { |
|
| 643 | 643 | static::$sharedConn = TestUtil::getConnection(); |
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
| 647 | 647 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ['mysql', 'postgresql'], true)) { |
| 648 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/'); |
|
| 648 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/'); |
|
| 649 | 649 | } elseif (static::$sharedConn->getDatabasePlatform()->getName() === 'oracle') { |
| 650 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual'); |
|
| 650 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/ FROM dual'); |
|
| 651 | 651 | } |
| 652 | 652 | } |
| 653 | 653 | |
| 654 | - if (! $this->em) { |
|
| 654 | + if ( ! $this->em) { |
|
| 655 | 655 | $this->em = $this->getEntityManager(); |
| 656 | 656 | $this->schemaTool = new SchemaTool($this->em); |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | foreach ($this->usedModelSets as $setName => $bool) { |
| 660 | - if (! isset(static::$tablesCreated[$setName])) { |
|
| 660 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
| 661 | 661 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
| 662 | 662 | |
| 663 | 663 | static::$tablesCreated[$setName] = true; |
@@ -732,8 +732,8 @@ discard block |
||
| 732 | 732 | |
| 733 | 733 | $config->setMetadataDriverImpl( |
| 734 | 734 | $mappingDriver ?? $config->newDefaultAnnotationDriver([ |
| 735 | - realpath(__DIR__ . '/Models/Cache'), |
|
| 736 | - realpath(__DIR__ . '/Models/GeoNames'), |
|
| 735 | + realpath(__DIR__.'/Models/Cache'), |
|
| 736 | + realpath(__DIR__.'/Models/GeoNames'), |
|
| 737 | 737 | ]) |
| 738 | 738 | ); |
| 739 | 739 | |
@@ -783,13 +783,13 @@ discard block |
||
| 783 | 783 | |
| 784 | 784 | foreach ($last25queries as $i => $query) { |
| 785 | 785 | $params = array_map( |
| 786 | - function ($p) { |
|
| 786 | + function($p) { |
|
| 787 | 787 | return is_object($p) ? get_class($p) : var_export($p, true); |
| 788 | 788 | }, |
| 789 | 789 | $query['params'] ?: [] |
| 790 | 790 | ); |
| 791 | 791 | |
| 792 | - $queries .= $i . ". SQL: '" . $query['sql'] . "' Params: " . implode(', ', $params) . PHP_EOL; |
|
| 792 | + $queries .= $i.". SQL: '".$query['sql']."' Params: ".implode(', ', $params).PHP_EOL; |
|
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | $trace = $e->getTrace(); |
@@ -802,11 +802,11 @@ discard block |
||
| 802 | 802 | break; |
| 803 | 803 | } |
| 804 | 804 | |
| 805 | - $traceMsg .= $part['file'] . ':' . $part['line'] . PHP_EOL; |
|
| 805 | + $traceMsg .= $part['file'].':'.$part['line'].PHP_EOL; |
|
| 806 | 806 | } |
| 807 | 807 | } |
| 808 | 808 | |
| 809 | - $message = '[' . get_class($e) . '] ' . $e->getMessage() . PHP_EOL . PHP_EOL . 'With queries:' . PHP_EOL . $queries . PHP_EOL . 'Trace:' . PHP_EOL . $traceMsg; |
|
| 809 | + $message = '['.get_class($e).'] '.$e->getMessage().PHP_EOL.PHP_EOL.'With queries:'.PHP_EOL.$queries.PHP_EOL.'Trace:'.PHP_EOL.$traceMsg; |
|
| 810 | 810 | |
| 811 | 811 | throw new \Exception($message, (int) $e->getCode(), $e); |
| 812 | 812 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Mapping; |
| 6 | 6 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | protected function loadDriver() |
| 21 | 21 | { |
| 22 | - return new XmlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'xml'); |
|
| 22 | + return new XmlDriver(__DIR__.DIRECTORY_SEPARATOR.'xml'); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function testClassTableInheritanceDiscriminatorMap() |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | public function testValidateXmlSchema($xmlMappingFile) |
| 164 | 164 | { |
| 165 | - $xsdSchemaFile = __DIR__ . '/../../../../../doctrine-mapping.xsd'; |
|
| 165 | + $xsdSchemaFile = __DIR__.'/../../../../../doctrine-mapping.xsd'; |
|
| 166 | 166 | $dom = new \DOMDocument('UTF-8'); |
| 167 | 167 | |
| 168 | 168 | $dom->load($xmlMappingFile); |
@@ -172,14 +172,14 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | public static function dataValidSchema() |
| 174 | 174 | { |
| 175 | - $list = glob(__DIR__ . '/xml/*.xml'); |
|
| 175 | + $list = glob(__DIR__.'/xml/*.xml'); |
|
| 176 | 176 | $invalid = ['Doctrine.Tests.Models.DDC889.DDC889Class.dcm']; |
| 177 | 177 | |
| 178 | - $list = array_filter($list, function ($item) use ($invalid) { |
|
| 178 | + $list = array_filter($list, function($item) use ($invalid) { |
|
| 179 | 179 | return ! in_array(pathinfo($item, PATHINFO_FILENAME), $invalid, true); |
| 180 | 180 | }); |
| 181 | 181 | |
| 182 | - return array_map(function ($item) { |
|
| 182 | + return array_map(function($item) { |
|
| 183 | 183 | return [$item]; |
| 184 | 184 | }, $list); |
| 185 | 185 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | use Doctrine\Tests\Models\CMS\CmsUser; |
| 14 | 14 | use Doctrine\Tests\OrmFunctionalTestCase; |
| 15 | 15 | |
| 16 | -require_once __DIR__ . '/../../TestInit.php'; |
|
| 16 | +require_once __DIR__.'/../../TestInit.php'; |
|
| 17 | 17 | |
| 18 | 18 | class CustomFunctionsTest extends OrmFunctionalTestCase |
| 19 | 19 | { |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | $this->em->flush(); |
| 34 | 34 | |
| 35 | 35 | // Instead of defining the function with the class name, we use a callback |
| 36 | - $this->em->getConfiguration()->addCustomStringFunction('FOO', function ($funcName) { |
|
| 36 | + $this->em->getConfiguration()->addCustomStringFunction('FOO', function($funcName) { |
|
| 37 | 37 | return new NoOp($funcName); |
| 38 | 38 | }); |
| 39 | - $this->em->getConfiguration()->addCustomNumericFunction('BAR', function ($funcName) { |
|
| 39 | + $this->em->getConfiguration()->addCustomNumericFunction('BAR', function($funcName) { |
|
| 40 | 40 | return new NoOp($funcName); |
| 41 | 41 | }); |
| 42 | 42 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | $contracts = $this->em->createQuery('SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c ORDER BY c.id')->getScalarResult(); |
| 232 | 232 | |
| 233 | - $discrValues = \array_map(function ($a) { |
|
| 233 | + $discrValues = \array_map(function($a) { |
|
| 234 | 234 | return $a['c_discr']; |
| 235 | 235 | }, $contracts); |
| 236 | 236 | |
@@ -332,19 +332,19 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | $repos = $this->em->getRepository(CompanyContract::class); |
| 334 | 334 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
| 335 | - self::assertCount(3, $contracts, 'There should be 3 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyContract'"); |
|
| 335 | + self::assertCount(3, $contracts, 'There should be 3 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyContract'"); |
|
| 336 | 336 | |
| 337 | 337 | $repos = $this->em->getRepository(CompanyFixContract::class); |
| 338 | 338 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
| 339 | - self::assertCount(1, $contracts, 'There should be 1 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFixContract'"); |
|
| 339 | + self::assertCount(1, $contracts, 'There should be 1 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFixContract'"); |
|
| 340 | 340 | |
| 341 | 341 | $repos = $this->em->getRepository(CompanyFlexContract::class); |
| 342 | 342 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
| 343 | - self::assertCount(2, $contracts, 'There should be 2 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexContract'"); |
|
| 343 | + self::assertCount(2, $contracts, 'There should be 2 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFlexContract'"); |
|
| 344 | 344 | |
| 345 | 345 | $repos = $this->em->getRepository(CompanyFlexUltraContract::class); |
| 346 | 346 | $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]); |
| 347 | - self::assertCount(1, $contracts, 'There should be 1 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexUltraContract'"); |
|
| 347 | + self::assertCount(1, $contracts, 'There should be 1 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFlexUltraContract'"); |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | /** |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | $this->secondLevelCacheLogger->clearStats(); |
| 805 | 805 | $this->em->clear(); |
| 806 | 806 | |
| 807 | - $getHash = function (AbstractQuery $query) { |
|
| 807 | + $getHash = function(AbstractQuery $query) { |
|
| 808 | 808 | $method = new \ReflectionMethod($query, 'getHash'); |
| 809 | 809 | $method->setAccessible(true); |
| 810 | 810 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | { |
| 200 | 200 | $listener = new ListenerSecondLevelCacheTest( |
| 201 | 201 | [ |
| 202 | - Events::postFlush => function () { |
|
| 202 | + Events::postFlush => function() { |
|
| 203 | 203 | throw new \RuntimeException('post flush failure'); |
| 204 | 204 | }, |
| 205 | 205 | ] |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | $listener = new ListenerSecondLevelCacheTest( |
| 235 | 235 | [ |
| 236 | - Events::postUpdate => function () { |
|
| 236 | + Events::postUpdate => function() { |
|
| 237 | 237 | throw new \RuntimeException('post update failure'); |
| 238 | 238 | }, |
| 239 | 239 | ] |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | self::assertInstanceOf(State::class, $state); |
| 253 | 253 | self::assertEquals($stateName, $state->getName()); |
| 254 | 254 | |
| 255 | - $state->setName($stateName . uniqid()); |
|
| 255 | + $state->setName($stateName.uniqid()); |
|
| 256 | 256 | |
| 257 | 257 | $this->em->persist($state); |
| 258 | 258 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $this->em->clear(); |
| 281 | 281 | |
| 282 | 282 | $listener = new ListenerSecondLevelCacheTest([ |
| 283 | - Events::postRemove => function () { |
|
| 283 | + Events::postRemove => function() { |
|
| 284 | 284 | throw new \RuntimeException('post remove failure'); |
| 285 | 285 | }, |
| 286 | 286 | ]); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests; |
| 6 | 6 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | $reader = new Annotations\CachedReader(new Annotations\AnnotationReader(), new ArrayCache()); |
| 68 | 68 | |
| 69 | - Annotations\AnnotationRegistry::registerFile(__DIR__ . '/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php'); |
|
| 69 | + Annotations\AnnotationRegistry::registerFile(__DIR__.'/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php'); |
|
| 70 | 70 | |
| 71 | 71 | return new AnnotationDriver($reader, (array) $paths); |
| 72 | 72 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 104 | 104 | $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL); |
| 105 | 105 | $config->setMetadataDriverImpl( |
| 106 | - $config->newDefaultAnnotationDriver([realpath(__DIR__ . '/Models/Cache')]) |
|
| 106 | + $config->newDefaultAnnotationDriver([realpath(__DIR__.'/Models/Cache')]) |
|
| 107 | 107 | ); |
| 108 | 108 | |
| 109 | 109 | if ($this->isSecondLevelCacheEnabled) { |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Cache; |
| 6 | 6 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | protected function createRegion() |
| 54 | 54 | { |
| 55 | - $this->directory = sys_get_temp_dir() . '/doctrine_lock_' . uniqid(); |
|
| 55 | + $this->directory = sys_get_temp_dir().'/doctrine_lock_'.uniqid(); |
|
| 56 | 56 | |
| 57 | 57 | $region = new DefaultRegion('concurren_region_test', $this->cache); |
| 58 | 58 | |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $reflectionDirectory->setAccessible(true); |
| 256 | 256 | $reflectionDirectory->setValue($region, str_repeat('a', 10000)); |
| 257 | 257 | |
| 258 | - set_error_handler(function () { |
|
| 258 | + set_error_handler(function() { |
|
| 259 | 259 | }, E_WARNING); |
| 260 | 260 | self::assertTrue($region->evictAll()); |
| 261 | 261 | restore_error_handler(); |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | { |
| 269 | 269 | $path = $path ?: $this->directory; |
| 270 | 270 | |
| 271 | - if (! is_dir($path)) { |
|
| 271 | + if ( ! is_dir($path)) { |
|
| 272 | 272 | return; |
| 273 | 273 | } |
| 274 | 274 | |