@@ -58,7 +58,7 @@ |
||
| 58 | 58 | protected $secondLevelCacheDriverImpl = null; |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | - * @param array $paths |
|
| 61 | + * @param string[] $paths |
|
| 62 | 62 | * |
| 63 | 63 | * @return \Doctrine\ORM\Mapping\Driver\AnnotationDriver |
| 64 | 64 | */ |
@@ -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 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | { |
| 68 | 68 | $reader = new Annotations\CachedReader(new Annotations\AnnotationReader(), new ArrayCache()); |
| 69 | 69 | |
| 70 | - Annotations\AnnotationRegistry::registerFile(__DIR__ . "/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php"); |
|
| 70 | + Annotations\AnnotationRegistry::registerFile(__DIR__."/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php"); |
|
| 71 | 71 | |
| 72 | 72 | return new AnnotationDriver($reader, (array) $paths); |
| 73 | 73 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL); |
| 107 | 107 | $config->setMetadataDriverImpl( |
| 108 | 108 | $config->newDefaultAnnotationDriver([ |
| 109 | - realpath(__DIR__ . '/Models/Cache') |
|
| 109 | + realpath(__DIR__.'/Models/Cache') |
|
| 110 | 110 | ]) |
| 111 | 111 | ); |
| 112 | 112 | |
@@ -2,28 +2,28 @@ |
||
| 2 | 2 | /* |
| 3 | 3 | * This file bootstraps the test environment. |
| 4 | 4 | */ |
| 5 | -declare(strict_types=1); |
|
| 5 | +declare(strict_types = 1); |
|
| 6 | 6 | |
| 7 | 7 | namespace Doctrine\Tests; |
| 8 | 8 | |
| 9 | 9 | error_reporting(E_ALL | E_STRICT); |
| 10 | 10 | date_default_timezone_set('UTC'); |
| 11 | 11 | |
| 12 | -if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { |
|
| 12 | +if (file_exists(__DIR__.'/../../../vendor/autoload.php')) { |
|
| 13 | 13 | // dependencies were installed via composer - this is the main project |
| 14 | - require __DIR__ . '/../../../vendor/autoload.php'; |
|
| 15 | -} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) { |
|
| 14 | + require __DIR__.'/../../../vendor/autoload.php'; |
|
| 15 | +} elseif (file_exists(__DIR__.'/../../../../../autoload.php')) { |
|
| 16 | 16 | // installed as a dependency in `vendor` |
| 17 | - require __DIR__ . '/../../../../../autoload.php'; |
|
| 17 | + require __DIR__.'/../../../../../autoload.php'; |
|
| 18 | 18 | } else { |
| 19 | 19 | throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?'); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -if ( ! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) { |
|
| 23 | - throw new \Exception("Could not create " . __DIR__."/Proxies Folder."); |
|
| 22 | +if ( ! file_exists(__DIR__.'/Proxies') && ! mkdir(__DIR__.'/Proxies')) { |
|
| 23 | + throw new \Exception("Could not create ".__DIR__."/Proxies Folder."); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | -if ( ! file_exists(__DIR__ . '/ORM/Proxy/generated') && ! mkdir(__DIR__ . '/ORM/Proxy/generated')) { |
|
| 27 | - throw new \Exception('Could not create ' . __DIR__ . '/ORM/Proxy/generated Folder.'); |
|
| 26 | +if ( ! file_exists(__DIR__.'/ORM/Proxy/generated') && ! mkdir(__DIR__.'/ORM/Proxy/generated')) { |
|
| 27 | + throw new \Exception('Could not create '.__DIR__.'/ORM/Proxy/generated Folder.'); |
|
| 28 | 28 | } |
| 29 | 29 | |
@@ -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; |
| 6 | 6 | |
@@ -786,7 +786,11 @@ |
||
| 786 | 786 | foreach ($last25queries as $i => $query) { |
| 787 | 787 | $params = array_map( |
| 788 | 788 | function($p) { |
| 789 | - if (is_object($p)) return get_class($p); else return var_export($p, true); |
|
| 789 | + if (is_object($p)) { |
|
| 790 | + return get_class($p); |
|
| 791 | + } else { |
|
| 792 | + return var_export($p, true); |
|
| 793 | + } |
|
| 790 | 794 | }, |
| 791 | 795 | $query['params'] ?: [] |
| 792 | 796 | ); |
@@ -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 | |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | $conn->executeUpdate('DELETE FROM RoutingLocation'); |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | - if(isset($this->usedModelSets['navigation'])) { |
|
| 405 | + if (isset($this->usedModelSets['navigation'])) { |
|
| 406 | 406 | $conn->executeUpdate('DELETE FROM navigation_tour_pois'); |
| 407 | 407 | $conn->executeUpdate('DELETE FROM navigation_photos'); |
| 408 | 408 | $conn->executeUpdate('DELETE FROM navigation_pois'); |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | $conn->executeUpdate('DELETE FROM navigation_countries'); |
| 411 | 411 | } |
| 412 | 412 | if (isset($this->usedModelSets['directorytree'])) { |
| 413 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("file")); |
|
| 413 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("file")); |
|
| 414 | 414 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
| 415 | 415 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
| 416 | 416 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -500,12 +500,12 @@ discard block |
||
| 500 | 500 | ) |
| 501 | 501 | ); |
| 502 | 502 | |
| 503 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
| 504 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-group")); |
|
| 505 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-phone")); |
|
| 506 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-user")); |
|
| 507 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-address")); |
|
| 508 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
| 503 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
| 504 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-group")); |
|
| 505 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-phone")); |
|
| 506 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-user")); |
|
| 507 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-address")); |
|
| 508 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -640,15 +640,15 @@ discard block |
||
| 640 | 640 | { |
| 641 | 641 | $this->setUpDBALTypes(); |
| 642 | 642 | |
| 643 | - if (! isset(static::$sharedConn)) { |
|
| 643 | + if ( ! isset(static::$sharedConn)) { |
|
| 644 | 644 | static::$sharedConn = TestUtil::getConnection(); |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
| 648 | 648 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ["mysql", "postgresql"])) { |
| 649 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/'); |
|
| 649 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/'); |
|
| 650 | 650 | } else if (static::$sharedConn->getDatabasePlatform()->getName() === "oracle") { |
| 651 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual'); |
|
| 651 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/ FROM dual'); |
|
| 652 | 652 | } |
| 653 | 653 | } |
| 654 | 654 | |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | } |
| 659 | 659 | |
| 660 | 660 | foreach ($this->usedModelSets as $setName => $bool) { |
| 661 | - if (! isset(static::$tablesCreated[$setName])) { |
|
| 661 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
| 662 | 662 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
| 663 | 663 | |
| 664 | 664 | static::$tablesCreated[$setName] = true; |
@@ -733,8 +733,8 @@ discard block |
||
| 733 | 733 | |
| 734 | 734 | $config->setMetadataDriverImpl( |
| 735 | 735 | $config->newDefaultAnnotationDriver([ |
| 736 | - realpath(__DIR__ . '/Models/Cache'), |
|
| 737 | - realpath(__DIR__ . '/Models/GeoNames') |
|
| 736 | + realpath(__DIR__.'/Models/Cache'), |
|
| 737 | + realpath(__DIR__.'/Models/GeoNames') |
|
| 738 | 738 | ]) |
| 739 | 739 | ); |
| 740 | 740 | |
@@ -798,9 +798,9 @@ discard block |
||
| 798 | 798 | $trace = $e->getTrace(); |
| 799 | 799 | $traceMsg = ""; |
| 800 | 800 | |
| 801 | - foreach($trace AS $part) { |
|
| 802 | - if(isset($part['file'])) { |
|
| 803 | - if(strpos($part['file'], "PHPUnit/") !== false) { |
|
| 801 | + foreach ($trace AS $part) { |
|
| 802 | + if (isset($part['file'])) { |
|
| 803 | + if (strpos($part['file'], "PHPUnit/") !== false) { |
|
| 804 | 804 | // Beginning with PHPUnit files we don't print the trace anymore. |
| 805 | 805 | break; |
| 806 | 806 | } |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | |
| 812 | 812 | $message = "[".get_class($e)."] ".$e->getMessage().PHP_EOL.PHP_EOL."With queries:".PHP_EOL.$queries.PHP_EOL."Trace:".PHP_EOL.$traceMsg; |
| 813 | 813 | |
| 814 | - throw new \Exception($message, (int)$e->getCode(), $e); |
|
| 814 | + throw new \Exception($message, (int) $e->getCode(), $e); |
|
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | throw $e; |
@@ -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\ORM; |
| 6 | 6 | |
@@ -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\ORM\Utility; |
| 6 | 6 | |
@@ -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\ORM\Mapping; |
| 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\ORM\Mapping; |
| 6 | 6 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | protected function loadDriver() |
| 22 | 22 | { |
| 23 | - return new XmlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'xml'); |
|
| 23 | + return new XmlDriver(__DIR__.DIRECTORY_SEPARATOR.'xml'); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | 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,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | static public function dataValidSchema() |
| 174 | 174 | { |
| 175 | - $list = glob(__DIR__ . '/xml/*.xml'); |
|
| 175 | + $list = glob(__DIR__.'/xml/*.xml'); |
|
| 176 | 176 | $invalid = [ |
| 177 | 177 | 'Doctrine.Tests.Models.DDC889.DDC889Class.dcm' |
| 178 | 178 | ]; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | return ! in_array(pathinfo($item, PATHINFO_FILENAME), $invalid); |
| 182 | 182 | }); |
| 183 | 183 | |
| 184 | - return array_map(function($item){ |
|
| 184 | + return array_map(function($item) { |
|
| 185 | 185 | return [$item]; |
| 186 | 186 | }, $list); |
| 187 | 187 | } |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 8 | 8 | use Doctrine\ORM\Mapping\ClassMetadataFactory; |
| 9 | 9 | use Doctrine\ORM\Mapping\Driver\XmlDriver; |
| 10 | -use Doctrine\ORM\Reflection\RuntimeReflectionService; |
|
| 11 | 10 | use Doctrine\Tests\Models\DDC117\DDC117Translation; |
| 12 | 11 | use Doctrine\Tests\Models\DDC3293\DDC3293User; |
| 13 | 12 | use Doctrine\Tests\Models\DDC3293\DDC3293UserPrefixed; |
@@ -1241,7 +1241,7 @@ |
||
| 1241 | 1241 | $association->setCascade(['invalid']); |
| 1242 | 1242 | |
| 1243 | 1243 | $cm->addProperty($association); |
| 1244 | - } |
|
| 1244 | + } |
|
| 1245 | 1245 | |
| 1246 | 1246 | /** |
| 1247 | 1247 | * @group DDC-964 |
@@ -29,7 +29,6 @@ |
||
| 29 | 29 | use Doctrine\Tests\Models\Routing\RoutingLeg; |
| 30 | 30 | use Doctrine\Tests\OrmTestCase; |
| 31 | 31 | use DoctrineGlobal_Article; |
| 32 | -use SebastianBergmann\Environment\Runtime; |
|
| 33 | 32 | |
| 34 | 33 | require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
| 35 | 34 | |
@@ -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 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | use DoctrineGlobal_Article; |
| 32 | 32 | use SebastianBergmann\Environment\Runtime; |
| 33 | 33 | |
| 34 | -require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 34 | +require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 35 | 35 | |
| 36 | 36 | class ClassMetadataTest extends OrmTestCase |
| 37 | 37 | { |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | public function testEmptyFieldNameThrowsException() |
| 805 | 805 | { |
| 806 | 806 | $this->expectException(MappingException::class); |
| 807 | - $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'."); |
|
| 807 | + $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'."); |
|
| 808 | 808 | |
| 809 | 809 | $cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
| 810 | 810 | $cm->setTable(new Mapping\TableMetadata('cms_users')); |
@@ -947,12 +947,12 @@ discard block |
||
| 947 | 947 | $mapping = $cm->getSqlResultSetMapping('find-all'); |
| 948 | 948 | |
| 949 | 949 | self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
| 950 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 951 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 950 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 951 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 952 | 952 | |
| 953 | 953 | self::assertEquals(CMS\CmsEmail::class, $mapping['entities'][1]['entityClass']); |
| 954 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
| 955 | - self::assertEquals(['name'=>'email','column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
| 954 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
| 955 | + self::assertEquals(['name'=>'email', 'column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
| 956 | 956 | |
| 957 | 957 | self::assertEquals('scalarColumn', $mapping['columns'][0]['name']); |
| 958 | 958 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
| 1149 | 1149 | $cm->addLifecycleCallback('notfound', 'postLoad'); |
| 1150 | 1150 | |
| 1151 | 1151 | $this->expectException(MappingException::class); |
| 1152 | - $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no method 'notfound' to be registered as lifecycle callback."); |
|
| 1152 | + $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no method 'notfound' to be registered as lifecycle callback."); |
|
| 1153 | 1153 | |
| 1154 | 1154 | $cm->validateLifecycleCallbacks(new RuntimeReflectionService()); |
| 1155 | 1155 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | $cm->addProperty($association); |
| 1170 | 1170 | |
| 1171 | 1171 | $this->expectException(MappingException::class); |
| 1172 | - $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '" . CMS\CmsUser::class . "#address'."); |
|
| 1172 | + $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '".CMS\CmsUser::class."#address'."); |
|
| 1173 | 1173 | |
| 1174 | 1174 | $cm->validateAssociations(); |
| 1175 | 1175 | } |
@@ -1510,6 +1510,6 @@ discard block |
||
| 1510 | 1510 | */ |
| 1511 | 1511 | public function propertyToColumnName($propertyName, $className = null) |
| 1512 | 1512 | { |
| 1513 | - return strtolower($this->classToTableName($className)) . '_' . $propertyName; |
|
| 1513 | + return strtolower($this->classToTableName($className)).'_'.$propertyName; |
|
| 1514 | 1514 | } |
| 1515 | 1515 | } |