@@ -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 | } |
@@ -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; |
@@ -17,7 +17,6 @@ |
||
| 17 | 17 | use Doctrine\Tests\Models\DDC2372\DDC2372Admin; |
| 18 | 18 | use Doctrine\Tests\Models\DDC2372\DDC2372User; |
| 19 | 19 | use Doctrine\Tests\OrmTestCase; |
| 20 | -use SebastianBergmann\Environment\Runtime; |
|
| 21 | 20 | |
| 22 | 21 | class EntityGeneratorTest extends OrmTestCase |
| 23 | 22 | { |
@@ -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\Tools; |
| 6 | 6 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $this->namespace = uniqid("doctrine_", false); |
| 54 | 54 | $this->tmpDir = sys_get_temp_dir(); |
| 55 | 55 | |
| 56 | - mkdir($this->tmpDir . \DIRECTORY_SEPARATOR . $this->namespace); |
|
| 56 | + mkdir($this->tmpDir.\DIRECTORY_SEPARATOR.$this->namespace); |
|
| 57 | 57 | |
| 58 | 58 | $this->generator = new EntityGenerator(); |
| 59 | 59 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function tearDown() |
| 68 | 68 | { |
| 69 | - $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->tmpDir . '/' . $this->namespace)); |
|
| 69 | + $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->tmpDir.'/'.$this->namespace)); |
|
| 70 | 70 | |
| 71 | 71 | foreach ($ri AS $file) { |
| 72 | 72 | /* @var $file \SplFileInfo */ |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - rmdir($this->tmpDir . '/' . $this->namespace); |
|
| 78 | + rmdir($this->tmpDir.'/'.$this->namespace); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function generateBookEntityFixture(array $embeddedClasses = []) |
| 87 | 87 | { |
| 88 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 88 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 89 | 89 | |
| 90 | - $metadata->setCustomRepositoryClassName($this->namespace . '\EntityGeneratorBookRepository'); |
|
| 90 | + $metadata->setCustomRepositoryClassName($this->namespace.'\EntityGeneratorBookRepository'); |
|
| 91 | 91 | |
| 92 | 92 | $tableMetadata = new Mapping\TableMetadata(); |
| 93 | 93 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | private function generateEntityTypeFixture(array $field) |
| 208 | 208 | { |
| 209 | - $metadata = new ClassMetadata($this->namespace . '\EntityType', $this->staticMetadataBuildingContext); |
|
| 209 | + $metadata = new ClassMetadata($this->namespace.'\EntityType', $this->staticMetadataBuildingContext); |
|
| 210 | 210 | |
| 211 | 211 | $tableMetadata = new Mapping\TableMetadata(); |
| 212 | 212 | $tableMetadata->setName('entity_type'); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | */ |
| 240 | 240 | private function generateIsbnEmbeddableFixture(array $embeddedClasses = [], $columnPrefix = null) |
| 241 | 241 | { |
| 242 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorIsbn', $this->staticMetadataBuildingContext); |
|
| 242 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorIsbn', $this->staticMetadataBuildingContext); |
|
| 243 | 243 | $metadata->isEmbeddedClass = true; |
| 244 | 244 | |
| 245 | 245 | $fieldMetadata = new Mapping\FieldMetadata('prefix'); |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | private function generateTestEmbeddableFixture() |
| 299 | 299 | { |
| 300 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorTestEmbeddable', $this->staticMetadataBuildingContext); |
|
| 300 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorTestEmbeddable', $this->staticMetadataBuildingContext); |
|
| 301 | 301 | |
| 302 | 302 | $metadata->isEmbeddedClass = true; |
| 303 | 303 | |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | private function loadEntityClass(ClassMetadata $metadata) |
| 341 | 341 | { |
| 342 | 342 | $className = basename(str_replace('\\', '/', $metadata->getClassName())); |
| 343 | - $path = $this->tmpDir . '/' . $this->namespace . '/' . $className . '.php'; |
|
| 343 | + $path = $this->tmpDir.'/'.$this->namespace.'/'.$className.'.php'; |
|
| 344 | 344 | |
| 345 | 345 | self::assertFileExists($path); |
| 346 | 346 | |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | |
| 492 | 492 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 493 | 493 | |
| 494 | - self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/EntityGeneratorBook.php~"); |
|
| 494 | + self::assertFileExists($this->tmpDir."/".$this->namespace."/EntityGeneratorBook.php~"); |
|
| 495 | 495 | |
| 496 | 496 | $book = $this->newInstance($metadata); |
| 497 | 497 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | */ |
| 636 | 636 | public function testMappedSuperclassAnnotationGeneration() |
| 637 | 637 | { |
| 638 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 638 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 639 | 639 | |
| 640 | 640 | $metadata->isMappedSuperclass = true; |
| 641 | 641 | |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | */ |
| 673 | 673 | public function testGenerateEntityWithSequenceGenerator() |
| 674 | 674 | { |
| 675 | - $metadata = new ClassMetadata($this->namespace . '\DDC1784Entity', $this->staticMetadataBuildingContext); |
|
| 675 | + $metadata = new ClassMetadata($this->namespace.'\DDC1784Entity', $this->staticMetadataBuildingContext); |
|
| 676 | 676 | |
| 677 | 677 | $fieldMetadata = new Mapping\FieldMetadata('id'); |
| 678 | 678 | $fieldMetadata->setType(Type::getType('integer')); |
@@ -689,8 +689,8 @@ discard block |
||
| 689 | 689 | |
| 690 | 690 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 691 | 691 | |
| 692 | - $filename = $this->tmpDir . DIRECTORY_SEPARATOR |
|
| 693 | - . $this->namespace . DIRECTORY_SEPARATOR . 'DDC1784Entity.php'; |
|
| 692 | + $filename = $this->tmpDir.DIRECTORY_SEPARATOR |
|
| 693 | + . $this->namespace.DIRECTORY_SEPARATOR.'DDC1784Entity.php'; |
|
| 694 | 694 | |
| 695 | 695 | self::assertFileExists($filename); |
| 696 | 696 | |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | */ |
| 711 | 711 | public function testGenerateEntityWithMultipleInverseJoinColumns() |
| 712 | 712 | { |
| 713 | - $metadata = new ClassMetadata($this->namespace . '\DDC2079Entity', $this->staticMetadataBuildingContext); |
|
| 713 | + $metadata = new ClassMetadata($this->namespace.'\DDC2079Entity', $this->staticMetadataBuildingContext); |
|
| 714 | 714 | |
| 715 | 715 | $fieldMetadata = new Mapping\FieldMetadata('id'); |
| 716 | 716 | $fieldMetadata->setType(Type::getType('integer')); |
@@ -749,14 +749,14 @@ discard block |
||
| 749 | 749 | $association = new Mapping\ManyToManyAssociationMetadata('centroCustos'); |
| 750 | 750 | |
| 751 | 751 | $association->setJoinTable($joinTable); |
| 752 | - $association->setTargetEntity($this->namespace . '\\DDC2079CentroCusto'); |
|
| 752 | + $association->setTargetEntity($this->namespace.'\\DDC2079CentroCusto'); |
|
| 753 | 753 | |
| 754 | 754 | $metadata->addProperty($association); |
| 755 | 755 | |
| 756 | 756 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 757 | 757 | |
| 758 | - $filename = $this->tmpDir . DIRECTORY_SEPARATOR |
|
| 759 | - . $this->namespace . DIRECTORY_SEPARATOR . 'DDC2079Entity.php'; |
|
| 758 | + $filename = $this->tmpDir.DIRECTORY_SEPARATOR |
|
| 759 | + . $this->namespace.DIRECTORY_SEPARATOR.'DDC2079Entity.php'; |
|
| 760 | 760 | |
| 761 | 761 | self::assertFileExists($filename); |
| 762 | 762 | |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | $method->setAccessible(true); |
| 788 | 788 | |
| 789 | 789 | foreach ($constants as $name => $value) { |
| 790 | - if( ! preg_match($pattern, $name)) { |
|
| 790 | + if ( ! preg_match($pattern, $name)) { |
|
| 791 | 791 | continue; |
| 792 | 792 | } |
| 793 | 793 | |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | $method->setAccessible(true); |
| 817 | 817 | |
| 818 | 818 | foreach ($constants as $name => $value) { |
| 819 | - if( ! preg_match($pattern, $name)) { |
|
| 819 | + if ( ! preg_match($pattern, $name)) { |
|
| 820 | 820 | continue; |
| 821 | 821 | } |
| 822 | 822 | |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | $method->setAccessible(true); |
| 846 | 846 | |
| 847 | 847 | foreach ($constants as $name => $value) { |
| 848 | - if( ! preg_match($pattern, $name)) { |
|
| 848 | + if ( ! preg_match($pattern, $name)) { |
|
| 849 | 849 | continue; |
| 850 | 850 | } |
| 851 | 851 | |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | public function testEntityTypeAlias(array $field) |
| 870 | 870 | { |
| 871 | 871 | $metadata = $this->generateEntityTypeFixture($field); |
| 872 | - $path = $this->tmpDir . '/'. $this->namespace . '/EntityType.php'; |
|
| 872 | + $path = $this->tmpDir.'/'.$this->namespace.'/EntityType.php'; |
|
| 873 | 873 | |
| 874 | 874 | self::assertFileExists($path); |
| 875 | 875 | require_once $path; |
@@ -882,8 +882,8 @@ discard block |
||
| 882 | 882 | $type = $field['phpType']; |
| 883 | 883 | $name = $field['fieldName']; |
| 884 | 884 | $value = $field['value']; |
| 885 | - $getter = "get" . ucfirst($name); |
|
| 886 | - $setter = "set" . ucfirst($name); |
|
| 885 | + $getter = "get".ucfirst($name); |
|
| 886 | + $setter = "set".ucfirst($name); |
|
| 887 | 887 | |
| 888 | 888 | self::assertPhpDocVarType($type, $reflClass->getProperty($name)); |
| 889 | 889 | self::assertPhpDocParamType($type, $reflClass->getMethod($setter)); |
@@ -906,13 +906,13 @@ discard block |
||
| 906 | 906 | $metadata = $cmf->getMetadataFor(get_class($user)); |
| 907 | 907 | |
| 908 | 908 | // @todo guilhermeblanco Fix this test as changing Entity class should never be allowed. |
| 909 | - $metadata->setClassName($this->namespace . "\DDC2372User"); |
|
| 909 | + $metadata->setClassName($this->namespace."\DDC2372User"); |
|
| 910 | 910 | |
| 911 | 911 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 912 | 912 | |
| 913 | - self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/DDC2372User.php"); |
|
| 913 | + self::assertFileExists($this->tmpDir."/".$this->namespace."/DDC2372User.php"); |
|
| 914 | 914 | |
| 915 | - require $this->tmpDir . "/" . $this->namespace . "/DDC2372User.php"; |
|
| 915 | + require $this->tmpDir."/".$this->namespace."/DDC2372User.php"; |
|
| 916 | 916 | |
| 917 | 917 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
| 918 | 918 | |
@@ -934,12 +934,12 @@ discard block |
||
| 934 | 934 | $metadata = $cmf->getMetadataFor(get_class($user)); |
| 935 | 935 | |
| 936 | 936 | // @todo guilhermeblanco Fix this test as changing Entity class should never be allowed. |
| 937 | - $metadata->setClassName($this->namespace . "\DDC2372Admin"); |
|
| 937 | + $metadata->setClassName($this->namespace."\DDC2372Admin"); |
|
| 938 | 938 | |
| 939 | 939 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 940 | 940 | |
| 941 | - self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/DDC2372Admin.php"); |
|
| 942 | - require $this->tmpDir . "/" . $this->namespace . "/DDC2372Admin.php"; |
|
| 941 | + self::assertFileExists($this->tmpDir."/".$this->namespace."/DDC2372Admin.php"); |
|
| 942 | + require $this->tmpDir."/".$this->namespace."/DDC2372Admin.php"; |
|
| 943 | 943 | |
| 944 | 944 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
| 945 | 945 | |
@@ -959,22 +959,22 @@ discard block |
||
| 959 | 959 | $cmf->setEntityManager($em); |
| 960 | 960 | |
| 961 | 961 | $ns = $this->namespace; |
| 962 | - $nsdir = $this->tmpDir . '/' . $ns; |
|
| 962 | + $nsdir = $this->tmpDir.'/'.$ns; |
|
| 963 | 963 | |
| 964 | 964 | // Dump DDC1590User into temp file |
| 965 | 965 | $content = str_replace( |
| 966 | 966 | 'namespace Doctrine\Tests\Models\DDC1590', |
| 967 | - 'namespace ' . $ns, |
|
| 968 | - file_get_contents(__DIR__ . '/../../Models/DDC1590/DDC1590User.php') |
|
| 967 | + 'namespace '.$ns, |
|
| 968 | + file_get_contents(__DIR__.'/../../Models/DDC1590/DDC1590User.php') |
|
| 969 | 969 | ); |
| 970 | 970 | |
| 971 | - $fname = $nsdir . "/DDC1590User.php"; |
|
| 971 | + $fname = $nsdir."/DDC1590User.php"; |
|
| 972 | 972 | file_put_contents($fname, $content); |
| 973 | 973 | |
| 974 | 974 | // Require DDC1590User |
| 975 | 975 | require $fname; |
| 976 | 976 | |
| 977 | - $metadata = $cmf->getMetadataFor($ns . '\DDC1590User'); |
|
| 977 | + $metadata = $cmf->getMetadataFor($ns.'\DDC1590User'); |
|
| 978 | 978 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 979 | 979 | |
| 980 | 980 | // class DDC1590User extends DDC1590Entity { ... } |
@@ -982,13 +982,13 @@ discard block |
||
| 982 | 982 | |
| 983 | 983 | // class _DDC1590User extends DDC1590Entity { ... } |
| 984 | 984 | $source2 = str_replace('class DDC1590User', 'class _DDC1590User', $source); |
| 985 | - $fname2 = $nsdir . "/_DDC1590User.php"; |
|
| 985 | + $fname2 = $nsdir."/_DDC1590User.php"; |
|
| 986 | 986 | file_put_contents($fname2, $source2); |
| 987 | 987 | require $fname2; |
| 988 | 988 | |
| 989 | 989 | // class __DDC1590User { ... } |
| 990 | 990 | $source3 = str_replace('class DDC1590User extends DDC1590Entity', 'class __DDC1590User', $source); |
| 991 | - $fname3 = $nsdir . "/__DDC1590User.php"; |
|
| 991 | + $fname3 = $nsdir."/__DDC1590User.php"; |
|
| 992 | 992 | file_put_contents($fname3, $source3); |
| 993 | 993 | require $fname3; |
| 994 | 994 | |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | $this->loadEntityClass($metadata); |
| 1152 | 1152 | |
| 1153 | 1153 | $className = basename(str_replace('\\', '/', $metadata->getClassName())); |
| 1154 | - $path = $this->tmpDir . '/' . $this->namespace . '/' . $className . '.php'; |
|
| 1154 | + $path = $this->tmpDir.'/'.$this->namespace.'/'.$className.'.php'; |
|
| 1155 | 1155 | $classTest = file_get_contents($path); |
| 1156 | 1156 | |
| 1157 | 1157 | $this->generator->setRegenerateEntityIfExists(true); |
@@ -1160,7 +1160,7 @@ discard block |
||
| 1160 | 1160 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 1161 | 1161 | $classNew = file_get_contents($path); |
| 1162 | 1162 | |
| 1163 | - self::assertSame($classTest,$classNew); |
|
| 1163 | + self::assertSame($classTest, $classNew); |
|
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | 1166 | /** |
@@ -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\ORM\Mapping; |
| 6 | 6 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * |
| 62 | 62 | * @return void |
| 63 | 63 | */ |
| 64 | - public function setCacheDriver(?Cache $cacheDriver = null) : void |
|
| 64 | + public function setCacheDriver(? Cache $cacheDriver = null) : void |
|
| 65 | 65 | { |
| 66 | 66 | $this->cacheDriver = $cacheDriver; |
| 67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * |
| 72 | 72 | * @return Cache|null |
| 73 | 73 | */ |
| 74 | - public function getCacheDriver() : ?Cache |
|
| 74 | + public function getCacheDriver() : ? Cache |
|
| 75 | 75 | { |
| 76 | 76 | return $this->cacheDriver; |
| 77 | 77 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public function getAllMetadata() : array |
| 153 | 153 | { |
| 154 | - if (! $this->initialized) { |
|
| 154 | + if ( ! $this->initialized) { |
|
| 155 | 155 | $this->initialize(); |
| 156 | 156 | } |
| 157 | 157 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | try { |
| 203 | 203 | if ($this->cacheDriver) { |
| 204 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
| 204 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
| 205 | 205 | |
| 206 | 206 | if ($cached instanceof ClassMetadata) { |
| 207 | 207 | $this->loadedMetadata[$realClassName] = $cached; |
@@ -211,14 +211,14 @@ discard block |
||
| 211 | 211 | foreach ($this->loadMetadata($realClassName, $metadataBuildingContext) as $loadedClass) { |
| 212 | 212 | $loadedClassName = $loadedClass->getClassName(); |
| 213 | 213 | |
| 214 | - $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, null); |
|
| 214 | + $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, null); |
|
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | } else { |
| 218 | 218 | $this->loadMetadata($realClassName, $metadataBuildingContext); |
| 219 | 219 | } |
| 220 | 220 | } catch (CommonMappingException $loadingException) { |
| 221 | - if (! $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName, $metadataBuildingContext)) { |
|
| 221 | + if ( ! $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName, $metadataBuildingContext)) { |
|
| 222 | 222 | throw $loadingException; |
| 223 | 223 | } |
| 224 | 224 | |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | protected function onNotFoundMetadata( |
| 343 | 343 | string $className, |
| 344 | 344 | ClassMetadataBuildingContext $metadataBuildingContext |
| 345 | - ) : ?ClassMetadata |
|
| 345 | + ) : ? ClassMetadata |
|
| 346 | 346 | { |
| 347 | 347 | return null; |
| 348 | 348 | } |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | */ |
| 405 | 405 | abstract protected function doLoadMetadata( |
| 406 | 406 | string $className, |
| 407 | - ?ClassMetadata $parent, |
|
| 407 | + ? ClassMetadata $parent, |
|
| 408 | 408 | ClassMetadataBuildingContext $metadataBuildingContext |
| 409 | 409 | ) : ClassMetadata; |
| 410 | 410 | |
@@ -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\ORM\Mapping; |
| 6 | 6 | |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | protected function onNotFoundMetadata( |
| 90 | 90 | string $className, |
| 91 | 91 | ClassMetadataBuildingContext $metadataBuildingContext |
| 92 | - ) : ?ClassMetadata |
|
| 92 | + ) : ? ClassMetadata |
|
| 93 | 93 | { |
| 94 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 94 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 95 | 95 | return null; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | protected function doLoadMetadata( |
| 112 | 112 | string $className, |
| 113 | - ?ClassMetadata $parent, |
|
| 113 | + ? ClassMetadata $parent, |
|
| 114 | 114 | ClassMetadataBuildingContext $metadataBuildingContext |
| 115 | 115 | ) : ClassMetadata |
| 116 | 116 | { |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 178 | + if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 179 | 179 | $this->addDefaultDiscriminatorMap($classMetadata); |
| 180 | 180 | } |
| 181 | 181 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | protected function completeRuntimeMetadata(ClassMetadata $class, ClassMetadata $parent = null) : void |
| 203 | 203 | { |
| 204 | - if (! $parent || ! $parent->isMappedSuperclass) { |
|
| 204 | + if ( ! $parent || ! $parent->isMappedSuperclass) { |
|
| 205 | 205 | return; |
| 206 | 206 | } |
| 207 | 207 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | continue; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
| 222 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
| 223 | 223 | continue; |
| 224 | 224 | } |
| 225 | 225 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | protected function validateRuntimeMetadata(ClassMetadata $class, ClassMetadata $parent = null) : void |
| 245 | 245 | { |
| 246 | - if (! $class->getReflectionClass()) { |
|
| 246 | + if ( ! $class->getReflectionClass()) { |
|
| 247 | 247 | // only validate if there is a reflection class instance |
| 248 | 248 | return; |
| 249 | 249 | } |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | |
| 549 | 549 | private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) |
| 550 | 550 | { |
| 551 | - if (!$field->hasValueGenerator()) { |
|
| 551 | + if ( ! $field->hasValueGenerator()) { |
|
| 552 | 552 | return; |
| 553 | 553 | } |
| 554 | 554 | |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | break; |
| 616 | 616 | |
| 617 | 617 | default: |
| 618 | - throw new ORMException("Unknown generator type: " . $generator->getType()); |
|
| 618 | + throw new ORMException("Unknown generator type: ".$generator->getType()); |
|
| 619 | 619 | } |
| 620 | 620 | } |
| 621 | 621 | |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | */ |
| 633 | 633 | protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) : string |
| 634 | 634 | { |
| 635 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 635 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | /** |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | */ |
| 657 | 657 | private function getTargetPlatform() : Platforms\AbstractPlatform |
| 658 | 658 | { |
| 659 | - if (!$this->targetPlatform) { |
|
| 659 | + if ( ! $this->targetPlatform) { |
|
| 660 | 660 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
| 661 | 661 | } |
| 662 | 662 | |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | $generatedProperties = []; |
| 675 | 675 | |
| 676 | 676 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 677 | - if (! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
| 677 | + if ( ! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
| 678 | 678 | continue; |
| 679 | 679 | } |
| 680 | 680 | |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Mapping; |
| 7 | 7 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | public function __toString() |
| 312 | 312 | { |
| 313 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
| 313 | + return __CLASS__.'@'.spl_object_hash($this); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | // Restore ReflectionClass and properties |
| 414 | 414 | $this->reflectionClass = $reflectionService->getClass($this->className); |
| 415 | 415 | |
| 416 | - if (! $this->reflectionClass) { |
|
| 416 | + if ( ! $this->reflectionClass) { |
|
| 417 | 417 | return; |
| 418 | 418 | } |
| 419 | 419 | |
@@ -439,11 +439,11 @@ discard block |
||
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | // Verify & complete identifier mapping |
| 442 | - if (! $this->identifier) { |
|
| 442 | + if ( ! $this->identifier) { |
|
| 443 | 443 | throw MappingException::identifierRequired($this->className); |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
| 446 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
| 447 | 447 | return $property instanceof FieldMetadata |
| 448 | 448 | && $property->isPrimaryKey() |
| 449 | 449 | && $property->hasValueGenerator(); |
@@ -464,14 +464,14 @@ discard block |
||
| 464 | 464 | public function validateAssociations() : void |
| 465 | 465 | { |
| 466 | 466 | array_map( |
| 467 | - function (Property $property) { |
|
| 468 | - if (! ($property instanceof AssociationMetadata)) { |
|
| 467 | + function(Property $property) { |
|
| 468 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
| 469 | 469 | return; |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | $targetEntity = $property->getTargetEntity(); |
| 473 | 473 | |
| 474 | - if (! class_exists($targetEntity)) { |
|
| 474 | + if ( ! class_exists($targetEntity)) { |
|
| 475 | 475 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
| 476 | 476 | } |
| 477 | 477 | }, |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | foreach ($this->lifecycleCallbacks as $callbacks) { |
| 494 | 494 | /** @var array $callbacks */ |
| 495 | 495 | foreach ($callbacks as $callbackFuncName) { |
| 496 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 496 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 497 | 497 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
| 498 | 498 | } |
| 499 | 499 | } |
@@ -521,11 +521,11 @@ discard block |
||
| 521 | 521 | */ |
| 522 | 522 | public function isIdentifier(string $fieldName) : bool |
| 523 | 523 | { |
| 524 | - if (! $this->identifier) { |
|
| 524 | + if ( ! $this->identifier) { |
|
| 525 | 525 | return false; |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | - if (! $this->isIdentifierComposite()) { |
|
| 528 | + if ( ! $this->isIdentifierComposite()) { |
|
| 529 | 529 | return $fieldName === $this->identifier[0]; |
| 530 | 530 | } |
| 531 | 531 | |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | */ |
| 554 | 554 | public function getNamedQuery($queryName) : string |
| 555 | 555 | { |
| 556 | - if (! isset($this->namedQueries[$queryName])) { |
|
| 556 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
| 557 | 557 | throw MappingException::queryNotFound($this->className, $queryName); |
| 558 | 558 | } |
| 559 | 559 | |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | */ |
| 614 | 614 | public function getSqlResultSetMapping($name) |
| 615 | 615 | { |
| 616 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
| 616 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
| 617 | 617 | throw MappingException::resultMappingNotFound($this->className, $name); |
| 618 | 618 | } |
| 619 | 619 | |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | $property->setColumnName($columnName); |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | - if (! $this->isMappedSuperclass) { |
|
| 651 | + if ( ! $this->isMappedSuperclass) { |
|
| 652 | 652 | $property->setTableName($this->getTableName()); |
| 653 | 653 | } |
| 654 | 654 | |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
| 669 | 669 | }; |
| 670 | 670 | |
| 671 | - if (! in_array($fieldName, $this->identifier)) { |
|
| 671 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
| 672 | 672 | $this->identifier[] = $fieldName; |
| 673 | 673 | } |
| 674 | 674 | } |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | $fieldName = $property->getName(); |
| 723 | 723 | $targetEntity = $property->getTargetEntity(); |
| 724 | 724 | |
| 725 | - if (! $targetEntity) { |
|
| 725 | + if ( ! $targetEntity) { |
|
| 726 | 726 | throw MappingException::missingTargetEntity($fieldName); |
| 727 | 727 | } |
| 728 | 728 | |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | $this->identifier[] = $property->getName(); |
| 754 | 754 | } |
| 755 | 755 | |
| 756 | - if ($this->cache && !$property->getCache()) { |
|
| 756 | + if ($this->cache && ! $property->getCache()) { |
|
| 757 | 757 | throw CacheException::nonCacheableEntityAssociation($this->className, $fieldName); |
| 758 | 758 | } |
| 759 | 759 | |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | /** @var JoinColumnMetadata $joinColumn */ |
| 808 | 808 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
| 809 | 809 | if (1 === count($property->getJoinColumns())) { |
| 810 | - if (! $property->isPrimaryKey()) { |
|
| 810 | + if ( ! $property->isPrimaryKey()) { |
|
| 811 | 811 | $joinColumn->setUnique(true); |
| 812 | 812 | } |
| 813 | 813 | } else { |
@@ -815,13 +815,13 @@ discard block |
||
| 815 | 815 | } |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 818 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 819 | 819 | |
| 820 | - if (! $joinColumn->getColumnName()) { |
|
| 820 | + if ( ! $joinColumn->getColumnName()) { |
|
| 821 | 821 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 824 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 825 | 825 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 826 | 826 | } |
| 827 | 827 | |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | if ($property->isOrphanRemoval()) { |
| 850 | 850 | $cascades = $property->getCascade(); |
| 851 | 851 | |
| 852 | - if (! in_array('remove', $cascades)) { |
|
| 852 | + if ( ! in_array('remove', $cascades)) { |
|
| 853 | 853 | $cascades[] = 'remove'; |
| 854 | 854 | |
| 855 | 855 | $property->setCascade($cascades); |
@@ -917,14 +917,14 @@ discard block |
||
| 917 | 917 | $property->setOwningSide(false); |
| 918 | 918 | |
| 919 | 919 | // OneToMany MUST have mappedBy |
| 920 | - if (! $property->getMappedBy()) { |
|
| 920 | + if ( ! $property->getMappedBy()) { |
|
| 921 | 921 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
| 922 | 922 | } |
| 923 | 923 | |
| 924 | 924 | if ($property->isOrphanRemoval()) { |
| 925 | 925 | $cascades = $property->getCascade(); |
| 926 | 926 | |
| 927 | - if (! in_array('remove', $cascades)) { |
|
| 927 | + if ( ! in_array('remove', $cascades)) { |
|
| 928 | 928 | $cascades[] = 'remove'; |
| 929 | 929 | |
| 930 | 930 | $property->setCascade($cascades); |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | |
| 948 | 948 | $property->setJoinTable($joinTable); |
| 949 | 949 | |
| 950 | - if (! $joinTable->getName()) { |
|
| 950 | + if ( ! $joinTable->getName()) { |
|
| 951 | 951 | $joinTableName = $this->namingStrategy->joinTableName( |
| 952 | 952 | $property->getSourceEntity(), |
| 953 | 953 | $property->getTargetEntity(), |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | |
| 960 | 960 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
| 961 | 961 | |
| 962 | - if (! $joinTable->getJoinColumns()) { |
|
| 962 | + if ( ! $joinTable->getJoinColumns()) { |
|
| 963 | 963 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 964 | 964 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
| 965 | 965 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -972,7 +972,7 @@ discard block |
||
| 972 | 972 | $joinTable->addJoinColumn($joinColumn); |
| 973 | 973 | } |
| 974 | 974 | |
| 975 | - if (! $joinTable->getInverseJoinColumns()) { |
|
| 975 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
| 976 | 976 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 977 | 977 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
| 978 | 978 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -987,13 +987,13 @@ discard block |
||
| 987 | 987 | |
| 988 | 988 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
| 989 | 989 | /** @var JoinColumnMetadata $joinColumn */ |
| 990 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 990 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 991 | 991 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 995 | 995 | |
| 996 | - if (! $joinColumn->getColumnName()) { |
|
| 996 | + if ( ! $joinColumn->getColumnName()) { |
|
| 997 | 997 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 998 | 998 | $property->getSourceEntity(), |
| 999 | 999 | $referencedColumnName |
@@ -1005,13 +1005,13 @@ discard block |
||
| 1005 | 1005 | |
| 1006 | 1006 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
| 1007 | 1007 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
| 1008 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 1008 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 1009 | 1009 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
| 1013 | 1013 | |
| 1014 | - if (! $inverseJoinColumn->getColumnName()) { |
|
| 1014 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
| 1015 | 1015 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 1016 | 1016 | $property->getTargetEntity(), |
| 1017 | 1017 | $referencedColumnName |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | // Association defined as Id field |
| 1109 | 1109 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1110 | 1110 | |
| 1111 | - if (! $property->isOwningSide()) { |
|
| 1111 | + if ( ! $property->isOwningSide()) { |
|
| 1112 | 1112 | $property = $targetClass->getProperty($property->getMappedBy()); |
| 1113 | 1113 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1114 | 1114 | } |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | $columnName = $joinColumn->getColumnName(); |
| 1124 | 1124 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1125 | 1125 | |
| 1126 | - if (! $joinColumn->getType()) { |
|
| 1126 | + if ( ! $joinColumn->getType()) { |
|
| 1127 | 1127 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
| 1128 | 1128 | } |
| 1129 | 1129 | |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | * |
| 1140 | 1140 | * @return string|null |
| 1141 | 1141 | */ |
| 1142 | - public function getTableName() : ?string |
|
| 1142 | + public function getTableName() : ? string |
|
| 1143 | 1143 | { |
| 1144 | 1144 | return $this->table->getName(); |
| 1145 | 1145 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
| 1149 | 1149 | * |
| 1150 | 1150 | * @return string|null |
| 1151 | 1151 | */ |
| 1152 | - public function getSchemaName() : ?string |
|
| 1152 | + public function getSchemaName() : ? string |
|
| 1153 | 1153 | { |
| 1154 | 1154 | return $this->table->getSchema(); |
| 1155 | 1155 | } |
@@ -1163,11 +1163,11 @@ discard block |
||
| 1163 | 1163 | { |
| 1164 | 1164 | $schema = null === $this->getSchemaName() |
| 1165 | 1165 | ? '' |
| 1166 | - : $this->getSchemaName() . '_' |
|
| 1166 | + : $this->getSchemaName().'_' |
|
| 1167 | 1167 | ; |
| 1168 | 1168 | |
| 1169 | 1169 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 1170 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
| 1170 | + return $schema.$this->getTableName().'_id_tmp'; |
|
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | 1173 | /** |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | { |
| 1228 | 1228 | $fieldName = $property->getName(); |
| 1229 | 1229 | |
| 1230 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
| 1230 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
| 1231 | 1231 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
| 1232 | 1232 | } |
| 1233 | 1233 | |
@@ -1347,7 +1347,7 @@ discard block |
||
| 1347 | 1347 | * |
| 1348 | 1348 | * @return LocalColumnMetadata|null |
| 1349 | 1349 | */ |
| 1350 | - public function getColumn(string $columnName): ?LocalColumnMetadata |
|
| 1350 | + public function getColumn(string $columnName): ? LocalColumnMetadata |
|
| 1351 | 1351 | { |
| 1352 | 1352 | foreach ($this->declaredProperties as $property) { |
| 1353 | 1353 | if ($property instanceof LocalColumnMetadata && $property->getColumnName() === $columnName) { |
@@ -1435,7 +1435,7 @@ discard block |
||
| 1435 | 1435 | $declaringClass = $property->getDeclaringClass(); |
| 1436 | 1436 | |
| 1437 | 1437 | if ($inheritedProperty instanceof FieldMetadata) { |
| 1438 | - if (! $declaringClass->isMappedSuperclass) { |
|
| 1438 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
| 1439 | 1439 | $inheritedProperty->setTableName($property->getTableName()); |
| 1440 | 1440 | } |
| 1441 | 1441 | |
@@ -1503,7 +1503,7 @@ discard block |
||
| 1503 | 1503 | throw MappingException::duplicateQueryMapping($this->className, $name); |
| 1504 | 1504 | } |
| 1505 | 1505 | |
| 1506 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1506 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1507 | 1507 | throw MappingException::missingQueryMapping($this->className, $name); |
| 1508 | 1508 | } |
| 1509 | 1509 | |
@@ -1526,7 +1526,7 @@ discard block |
||
| 1526 | 1526 | */ |
| 1527 | 1527 | public function addSqlResultSetMapping(array $resultMapping) |
| 1528 | 1528 | { |
| 1529 | - if (!isset($resultMapping['name'])) { |
|
| 1529 | + if ( ! isset($resultMapping['name'])) { |
|
| 1530 | 1530 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
| 1531 | 1531 | } |
| 1532 | 1532 | |
@@ -1536,7 +1536,7 @@ discard block |
||
| 1536 | 1536 | |
| 1537 | 1537 | if (isset($resultMapping['entities'])) { |
| 1538 | 1538 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
| 1539 | - if (! isset($entityResult['entityClass'])) { |
|
| 1539 | + if ( ! isset($entityResult['entityClass'])) { |
|
| 1540 | 1540 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
| 1541 | 1541 | } |
| 1542 | 1542 | |
@@ -1549,11 +1549,11 @@ discard block |
||
| 1549 | 1549 | |
| 1550 | 1550 | if (isset($entityResult['fields'])) { |
| 1551 | 1551 | foreach ($entityResult['fields'] as $k => $field) { |
| 1552 | - if (! isset($field['name'])) { |
|
| 1552 | + if ( ! isset($field['name'])) { |
|
| 1553 | 1553 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
| 1554 | 1554 | } |
| 1555 | 1555 | |
| 1556 | - if (! isset($field['column'])) { |
|
| 1556 | + if ( ! isset($field['column'])) { |
|
| 1557 | 1557 | $fieldName = $field['name']; |
| 1558 | 1558 | |
| 1559 | 1559 | if (strpos($fieldName, '.')) { |
@@ -1577,7 +1577,7 @@ discard block |
||
| 1577 | 1577 | * |
| 1578 | 1578 | * @return void |
| 1579 | 1579 | */ |
| 1580 | - public function setCustomRepositoryClassName(?string $repositoryClassName) |
|
| 1580 | + public function setCustomRepositoryClassName(? string $repositoryClassName) |
|
| 1581 | 1581 | { |
| 1582 | 1582 | $this->customRepositoryClassName = $repositoryClassName; |
| 1583 | 1583 | } |
@@ -1585,7 +1585,7 @@ discard block |
||
| 1585 | 1585 | /** |
| 1586 | 1586 | * @return string|null |
| 1587 | 1587 | */ |
| 1588 | - public function getCustomRepositoryClassName() : ?string |
|
| 1588 | + public function getCustomRepositoryClassName() : ? string |
|
| 1589 | 1589 | { |
| 1590 | 1590 | return $this->customRepositoryClassName; |
| 1591 | 1591 | } |
@@ -1662,11 +1662,11 @@ discard block |
||
| 1662 | 1662 | 'method' => $method, |
| 1663 | 1663 | ]; |
| 1664 | 1664 | |
| 1665 | - if (! class_exists($class)) { |
|
| 1665 | + if ( ! class_exists($class)) { |
|
| 1666 | 1666 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
| 1667 | 1667 | } |
| 1668 | 1668 | |
| 1669 | - if (! method_exists($class, $method)) { |
|
| 1669 | + if ( ! method_exists($class, $method)) { |
|
| 1670 | 1670 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
| 1671 | 1671 | } |
| 1672 | 1672 | |
@@ -1742,7 +1742,7 @@ discard block |
||
| 1742 | 1742 | return; |
| 1743 | 1743 | } |
| 1744 | 1744 | |
| 1745 | - if (! (class_exists($className) || interface_exists($className))) { |
|
| 1745 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
| 1746 | 1746 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
| 1747 | 1747 | } |
| 1748 | 1748 | |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Mapping; |
| 7 | 7 | use Doctrine\ORM\Reflection\RuntimePublicReflectionProperty; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * @return ComponentMetadata|null |
| 78 | 78 | */ |
| 79 | - public function getParent() : ?ComponentMetadata |
|
| 79 | + public function getParent() : ? ComponentMetadata |
|
| 80 | 80 | { |
| 81 | 81 | return $this->parent; |
| 82 | 82 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * @return \ReflectionClass|null |
| 86 | 86 | */ |
| 87 | - public function getReflectionClass() : ?\ReflectionClass |
|
| 87 | + public function getReflectionClass() : ? \ReflectionClass |
|
| 88 | 88 | { |
| 89 | 89 | return $this->reflectionClass; |
| 90 | 90 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @return void |
| 96 | 96 | */ |
| 97 | - public function setCache(?CacheMetadata $cache = null) : void |
|
| 97 | + public function setCache(? CacheMetadata $cache = null) : void |
|
| 98 | 98 | { |
| 99 | 99 | $this->cache = $cache; |
| 100 | 100 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | /** |
| 103 | 103 | * @return CacheMetadata|null |
| 104 | 104 | */ |
| 105 | - public function getCache(): ?CacheMetadata |
|
| 105 | + public function getCache(): ? CacheMetadata |
|
| 106 | 106 | { |
| 107 | 107 | return $this->cache; |
| 108 | 108 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | $declaredPropertiesIterator = $this->getDeclaredPropertiesIterator(); |
| 167 | 167 | |
| 168 | - if (! $this->parent) { |
|
| 168 | + if ( ! $this->parent) { |
|
| 169 | 169 | return $declaredPropertiesIterator; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * |
| 183 | 183 | * @return null|Property |
| 184 | 184 | */ |
| 185 | - public function getProperty(string $propertyName) : ?Property |
|
| 185 | + public function getProperty(string $propertyName) : ? Property |
|
| 186 | 186 | { |
| 187 | 187 | if (isset($this->declaredProperties[$propertyName])) { |
| 188 | 188 | return $this->declaredProperties[$propertyName]; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * |
| 242 | 242 | * @return string|null null if the input value is null |
| 243 | 243 | */ |
| 244 | - public function fullyQualifiedClassName(?string $className) : ?string |
|
| 244 | + public function fullyQualifiedClassName(? string $className) : ? string |
|
| 245 | 245 | { |
| 246 | 246 | if ($className === null || ! $this->reflectionClass) { |
| 247 | 247 | return $className; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * <http://www.doctrine-project.org>. |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | -declare(strict_types=1); |
|
| 21 | +declare(strict_types = 1); |
|
| 22 | 22 | |
| 23 | 23 | namespace Doctrine\ORM\Mapping; |
| 24 | 24 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | public function __construct( |
| 66 | 66 | AbstractClassMetadataFactory $classMetadataFactory, |
| 67 | 67 | ReflectionService $reflectionService, |
| 68 | - ?NamingStrategy $namingStrategy = null |
|
| 68 | + ? NamingStrategy $namingStrategy = null |
|
| 69 | 69 | ) |
| 70 | 70 | { |
| 71 | 71 | $this->classMetadataFactory = $classMetadataFactory; |
@@ -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 | |
@@ -113,15 +113,15 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php"; |
| 115 | 115 | |
| 116 | - $metadataDriver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Global/']); |
|
| 116 | + $metadataDriver = $this->createAnnotationDriver([__DIR__.'/../../Models/Global/']); |
|
| 117 | 117 | |
| 118 | 118 | $entityManager = $this->createEntityManager($metadataDriver); |
| 119 | 119 | |
| 120 | 120 | $mf = $entityManager->getMetadataFactory(); |
| 121 | 121 | $m1 = $mf->getMetadataFor(DoctrineGlobal_Article::class); |
| 122 | 122 | $h1 = $mf->hasMetadataFor(DoctrineGlobal_Article::class); |
| 123 | - $h2 = $mf->hasMetadataFor('\\' . DoctrineGlobal_Article::class); |
|
| 124 | - $m2 = $mf->getMetadataFor('\\' . DoctrineGlobal_Article::class); |
|
| 123 | + $h2 = $mf->hasMetadataFor('\\'.DoctrineGlobal_Article::class); |
|
| 124 | + $m2 = $mf->getMetadataFor('\\'.DoctrineGlobal_Article::class); |
|
| 125 | 125 | |
| 126 | 126 | self::assertNotSame($m1, $m2); |
| 127 | 127 | self::assertFalse($h2); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | public function testAddDefaultDiscriminatorMap() |
| 177 | 177 | { |
| 178 | 178 | $cmf = new ClassMetadataFactory(); |
| 179 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/JoinedInheritanceType/']); |
|
| 179 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/JoinedInheritanceType/']); |
|
| 180 | 180 | $em = $this->createEntityManager($driver); |
| 181 | 181 | $cmf->setEntityManager($em); |
| 182 | 182 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | { |
| 217 | 217 | // DDC-3551 |
| 218 | 218 | $conn = $this->createMock(Connection::class); |
| 219 | - $mockDriver = new MetadataDriverMock(); |
|
| 219 | + $mockDriver = new MetadataDriverMock(); |
|
| 220 | 220 | $em = $this->createEntityManager($mockDriver, $conn); |
| 221 | 221 | |
| 222 | 222 | $conn->expects($this->any()) |
@@ -237,12 +237,12 @@ discard block |
||
| 237 | 237 | $driverMock = new DriverMock(); |
| 238 | 238 | $config = new Configuration(); |
| 239 | 239 | |
| 240 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
| 240 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
| 241 | 241 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 242 | 242 | |
| 243 | 243 | $eventManager = new EventManager(); |
| 244 | 244 | |
| 245 | - if (!$conn) { |
|
| 245 | + if ( ! $conn) { |
|
| 246 | 246 | $conn = new ConnectionMock([], $driverMock, $config, $eventManager); |
| 247 | 247 | } |
| 248 | 248 | |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | public function testQuoteMetadata() |
| 333 | 333 | { |
| 334 | 334 | $cmf = new ClassMetadataFactory(); |
| 335 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Quote/']); |
|
| 335 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/Quote/']); |
|
| 336 | 336 | $em = $this->createEntityManager($driver); |
| 337 | 337 | $cmf->setEntityManager($em); |
| 338 | 338 | |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $listener |
| 422 | 422 | ->expects($this->any()) |
| 423 | 423 | ->method('onClassMetadataNotFound') |
| 424 | - ->will($this->returnCallback(function (OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
| 424 | + ->will($this->returnCallback(function(OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
| 425 | 425 | $test->assertNull($args->getFoundMetadata()); |
| 426 | 426 | $test->assertSame('Foo', $args->getClassName()); |
| 427 | 427 | $test->assertSame($em, $args->getObjectManager()); |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | public function testInheritsIdGeneratorMappingFromEmbeddable() |
| 484 | 484 | { |
| 485 | 485 | $cmf = new ClassMetadataFactory(); |
| 486 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/DDC4006/']); |
|
| 486 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/DDC4006/']); |
|
| 487 | 487 | $em = $this->createEntityManager($driver); |
| 488 | 488 | $cmf->setEntityManager($em); |
| 489 | 489 | |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | |
| 502 | 502 | protected function newClassMetadataInstance( |
| 503 | 503 | string $className, |
| 504 | - ?Mapping\ClassMetadata $parent, |
|
| 504 | + ? Mapping\ClassMetadata $parent, |
|
| 505 | 505 | Mapping\ClassMetadataBuildingContext $metadataBuildingContext |
| 506 | 506 | ) : ClassMetadata |
| 507 | 507 | { |