@@ -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 | |
@@ -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 | } |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | $config->setMetadataCacheImpl($metadataCache); |
| 98 | 98 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([])); |
| 99 | 99 | $config->setQueryCacheImpl(self::getSharedQueryCacheImpl()); |
| 100 | - $config->setProxyDir(__DIR__ . '/Proxies'); |
|
| 100 | + $config->setProxyDir(__DIR__.'/Proxies'); |
|
| 101 | 101 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 102 | 102 | $config->setMetadataDriverImpl( |
| 103 | 103 | $config->newDefaultAnnotationDriver([ |
| 104 | - realpath(__DIR__ . '/Models/Cache') |
|
| 104 | + realpath(__DIR__.'/Models/Cache') |
|
| 105 | 105 | ]) |
| 106 | 106 | ); |
| 107 | 107 | |
@@ -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 | |
@@ -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\Proxy; |
| 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 | { |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | $namingStrategy |
| 621 | 621 | ); |
| 622 | 622 | |
| 623 | - $metadata = new ClassMetadata(CMS\CmsAddress::class, $this->metadataBuildingContext); |
|
| 623 | + $metadata = new ClassMetadata(CMS\CmsAddress::class, $this->metadataBuildingContext); |
|
| 624 | 624 | |
| 625 | 625 | $association = new Mapping\ManyToManyAssociationMetadata('user'); |
| 626 | 626 | |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | public function testEmptyFieldNameThrowsException() |
| 776 | 776 | { |
| 777 | 777 | $this->expectException(MappingException::class); |
| 778 | - $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'."); |
|
| 778 | + $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'."); |
|
| 779 | 779 | |
| 780 | 780 | $cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
| 781 | 781 | |
@@ -913,12 +913,12 @@ discard block |
||
| 913 | 913 | $mapping = $cm->getSqlResultSetMapping('find-all'); |
| 914 | 914 | |
| 915 | 915 | self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
| 916 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 917 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 916 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 917 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 918 | 918 | |
| 919 | 919 | self::assertEquals(CMS\CmsEmail::class, $mapping['entities'][1]['entityClass']); |
| 920 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
| 921 | - self::assertEquals(['name'=>'email','column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
| 920 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
| 921 | + self::assertEquals(['name'=>'email', 'column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
| 922 | 922 | |
| 923 | 923 | self::assertEquals('scalarColumn', $mapping['columns'][0]['name']); |
| 924 | 924 | } |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | $cm->addLifecycleCallback('notfound', 'postLoad'); |
| 1107 | 1107 | |
| 1108 | 1108 | $this->expectException(MappingException::class); |
| 1109 | - $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no method 'notfound' to be registered as lifecycle callback."); |
|
| 1109 | + $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no method 'notfound' to be registered as lifecycle callback."); |
|
| 1110 | 1110 | |
| 1111 | 1111 | $cm->validateLifecycleCallbacks(new RuntimeReflectionService()); |
| 1112 | 1112 | } |
@@ -1125,7 +1125,7 @@ discard block |
||
| 1125 | 1125 | $cm->addProperty($association); |
| 1126 | 1126 | |
| 1127 | 1127 | $this->expectException(MappingException::class); |
| 1128 | - $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '" . CMS\CmsUser::class . "#address'."); |
|
| 1128 | + $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '".CMS\CmsUser::class."#address'."); |
|
| 1129 | 1129 | |
| 1130 | 1130 | $cm->validateAssociations(); |
| 1131 | 1131 | } |
@@ -1451,6 +1451,6 @@ discard block |
||
| 1451 | 1451 | */ |
| 1452 | 1452 | public function propertyToColumnName($propertyName, $className = null) |
| 1453 | 1453 | { |
| 1454 | - return strtolower($this->classToTableName($className)) . '_' . $propertyName; |
|
| 1454 | + return strtolower($this->classToTableName($className)).'_'.$propertyName; |
|
| 1455 | 1455 | } |
| 1456 | 1456 | } |