From a06011daf39ea2623c57a23dcf4465edbf061c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 27 Apr 2022 23:23:02 +0200 Subject: [PATCH 1/4] Refer to ClassMetadata instead of ClassMetadataInfo Although properties and methods are currently located in ClassMetadataInfo, it is better to refer to ClassMetadata as the former is deprecated in favor of the latter. --- docs/en/cookbook/sql-table-prefixes.rst | 2 +- docs/en/reference/tools.rst | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/en/cookbook/sql-table-prefixes.rst b/docs/en/cookbook/sql-table-prefixes.rst index 5ea587986b6..dc4ae6952df 100644 --- a/docs/en/cookbook/sql-table-prefixes.rst +++ b/docs/en/cookbook/sql-table-prefixes.rst @@ -47,7 +47,7 @@ appropriate autoloaders. } foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { - if ($mapping['type'] == \Doctrine\ORM\Mapping\ClassMetadataInfo::MANY_TO_MANY && $mapping['isOwningSide']) { + if ($mapping['type'] == \Doctrine\ORM\Mapping\ClassMetadata::MANY_TO_MANY && $mapping['isOwningSide']) { $mappedTableName = $mapping['joinTable']['name']; $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName; } diff --git a/docs/en/reference/tools.rst b/docs/en/reference/tools.rst index a215c385031..5c290ccebf9 100644 --- a/docs/en/reference/tools.rst +++ b/docs/en/reference/tools.rst @@ -149,7 +149,7 @@ When using the SchemaTool class directly, create your schema using the ``createSchema()`` method. First create an instance of the ``SchemaTool`` and pass it an instance of the ``EntityManager`` that you want to use to create the schema. This method receives an -array of ``ClassMetadataInfo`` instances. +array of ``ClassMetadata`` instances. .. code-block:: php @@ -180,8 +180,8 @@ tables of the current model to clean up with orphaned tables. You can also use database introspection to update your schema easily with the ``updateSchema()`` method. It will compare your -existing database schema to the passed array of -``ClassMetadataInfo`` instances. +existing database schema to the passed array of ``ClassMetadata`` +instances. .. code-block:: php @@ -324,9 +324,9 @@ convert to and the path to generate it: Reverse Engineering ------------------- -You can use the ``DatabaseDriver`` to reverse engineer a database -to an array of ``ClassMetadataInfo`` instances and generate YAML, -XML, etc. from them. +You can use the ``DatabaseDriver`` to reverse engineer a database to an +array of ``ClassMetadata`` instances and generate YAML, XML, etc. from +them. .. note:: From 6d2ca8fe40e35cf9f1e30c61d0c6bd6753c70e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 27 Apr 2022 23:24:12 +0200 Subject: [PATCH 2/4] Address mapping driver extraction This documentation must be very old because this is no longer valid as of e9e36dcf328218f07e88b5ffa9db9bd4ff593275 . The interface and abstract file driver have since then been moved to doctrine/common, and the to doctrine/persistence. --- docs/en/reference/metadata-drivers.rst | 78 +++++++++++++++----------- 1 file changed, 46 insertions(+), 32 deletions(-) diff --git a/docs/en/reference/metadata-drivers.rst b/docs/en/reference/metadata-drivers.rst index 9b0d521db3a..0c3d5677678 100644 --- a/docs/en/reference/metadata-drivers.rst +++ b/docs/en/reference/metadata-drivers.rst @@ -55,51 +55,66 @@ Implementing Metadata Drivers In addition to the included metadata drivers you can very easily implement your own. All you need to do is define a class which -implements the ``Driver`` interface: +implements the ``MappingDriver`` interface: .. code-block:: php $className + * @psalm-param ClassMetadata $metadata + * + * @return void + * + * @template T of object */ - function loadMetadataForClass($className, ClassMetadataInfo $metadata); - + public function loadMetadataForClass(string $className, ClassMetadata $metadata); + /** * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. + * + * @return array The names of all mapped classes known to this driver. + * @psalm-return list */ - function getAllClassNames(); - + public function getAllClassNames(); + /** - * Whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped as an Entity or a - * MappedSuperclass. + * Returns whether the class with the specified name should have its metadata loaded. + * This is only the case if it is either mapped as an Entity or a MappedSuperclass. + * + * @psalm-param class-string $className * - * @param string $className - * @return boolean + * @return bool */ - function isTransient($className); + public function isTransient(string $className); } If you want to write a metadata driver to parse information from some file format we've made your life a little easier by providing -the ``AbstractFileDriver`` implementation for you to extend from: +the ``FileDriver`` implementation for you to extend from: .. code-block:: php _loadMappingFile($file); - // populate ClassMetadataInfo instance from $data + // populate ClassMetadata instance from $data } /** @@ -127,13 +142,12 @@ the ``AbstractFileDriver`` implementation for you to extend from: .. note:: - When using the ``AbstractFileDriver`` it requires that you - only have one entity defined per file and the file named after the - class described inside where namespace separators are replaced by - periods. So if you have an entity named ``Entities\User`` and you - wanted to write a mapping file for your driver above you would need - to name the file ``Entities.User.dcm.ext`` for it to be - recognized. + When using the ``FileDriver`` it requires that you only have one + entity defined per file and the file named after the class described + inside where namespace separators are replaced by periods. So if you + have an entity named ``Entities\User`` and you wanted to write a + mapping file for your driver above you would need to name the file + ``Entities.User.dcm.ext`` for it to be recognized. Now you can use your ``MyMetadataDriver`` implementation by setting From e9d3c218ef8cef9d193b8bd48d74c766bc329ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 27 Apr 2022 23:26:07 +0200 Subject: [PATCH 3/4] Remove explanation about inexistent distinction ClassMetadataInfo used to be useful during entity generation, because it allowed the entity not to exist. We no longer do entity generation, and even if we did, the reflection methods have been moved to ClassMetadataInfo as of 76e4f5a80bf8faa6e00ec4746c34f2e4bfd4215e . --- docs/en/reference/metadata-drivers.rst | 8 -------- docs/en/reference/php-mapping.rst | 21 +++++++++------------ 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/docs/en/reference/metadata-drivers.rst b/docs/en/reference/metadata-drivers.rst index 0c3d5677678..d7b04f11b14 100644 --- a/docs/en/reference/metadata-drivers.rst +++ b/docs/en/reference/metadata-drivers.rst @@ -170,14 +170,6 @@ entity when needed. You have all the methods you need to manually specify the mapping information instead of using some mapping file to populate it from. -The base ``ClassMetadataInfo`` class is responsible for only data -storage and is not meant for runtime use. It does not require that -the class actually exists yet so it is useful for describing some -entity before it exists and using that information to generate for -example the entities themselves. The class ``ClassMetadata`` -extends ``ClassMetadataInfo`` and adds some functionality required -for runtime usage and requires that the PHP class is present and -can be autoloaded. You can read more about the API of the ``ClassMetadata`` classes in the PHP Mapping chapter. diff --git a/docs/en/reference/php-mapping.rst b/docs/en/reference/php-mapping.rst index 0b4557136fc..4ce2b525528 100644 --- a/docs/en/reference/php-mapping.rst +++ b/docs/en/reference/php-mapping.rst @@ -185,13 +185,12 @@ It also has several methods that create builders (which are necessary for advanc - ``createManyToMany($name, $targetEntity)`` returns an ``ManyToManyAssociationBuilder`` instance - ``createOneToMany($name, $targetEntity)`` returns an ``OneToManyAssociationBuilder`` instance -ClassMetadataInfo API ---------------------- +ClassMetadata API +----------------- -The ``ClassMetadataInfo`` class is the base data object for storing -the mapping metadata for a single entity. It contains all the -getters and setters you need populate and retrieve information for -an entity. +The ``ClassMetadata`` class is the data object for storing the mapping +metadata for a single entity. It contains all the getters and setters +you need populate and retrieve information for an entity. General Setters ~~~~~~~~~~~~~~~ @@ -309,13 +308,11 @@ Lifecycle Callback Getters - ``hasLifecycleCallbacks($lifecycleEvent)`` - ``getLifecycleCallbacks($event)`` -ClassMetadata API ------------------ +Runtime reflection methods +~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``ClassMetadata`` class extends ``ClassMetadataInfo`` and adds -the runtime functionality required by Doctrine. It adds a few extra -methods related to runtime reflection for working with the entities -themselves. +These are methods related to runtime reflection for working with the +entities themselves. - ``getReflectionClass()`` From 0078a677866c6c097c0c7b315b27159512fb9aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 28 Apr 2022 21:35:33 +0200 Subject: [PATCH 4/4] Use ClassMetadata over ClassMetadataInfo in tests ClassMetadataInfo is deprecated in favor of ClassMetadata. --- .../Doctrine/Tests/Models/CMS/CmsAddress.php | 4 +- tests/Doctrine/Tests/Models/CMS/CmsUser.php | 4 +- tests/Doctrine/Tests/Models/Cache/City.php | 4 +- .../Tests/Models/Company/CompanyContract.php | 3 +- .../Models/Company/CompanyFixContract.php | 4 +- .../Models/Company/CompanyFlexContract.php | 4 +- .../Company/CompanyFlexUltraContract.php | 4 +- .../Tests/Models/Company/CompanyPerson.php | 4 +- .../DDC1476EntityWithDefaultFieldType.php | 6 +-- .../Tests/Models/DDC3579/DDC3579User.php | 4 +- .../Models/DDC869/DDC869ChequePayment.php | 4 +- .../Models/DDC869/DDC869CreditCardPayment.php | 4 +- .../Tests/Models/DDC869/DDC869Payment.php | 6 +-- .../Tests/Models/DDC889/DDC889Class.php | 6 +-- .../Tests/Models/DDC889/DDC889Entity.php | 4 +- .../Tests/Models/DDC889/DDC889SuperClass.php | 6 +-- .../Tests/Models/DDC964/DDC964Admin.php | 4 +- .../Tests/Models/DDC964/DDC964Guest.php | 4 +- .../Tests/Models/DDC964/DDC964User.php | 6 +-- tests/Doctrine/Tests/Models/Enums/Card.php | 4 +- .../Tests/Models/Enums/CardWithNullable.php | 4 +- tests/Doctrine/Tests/Models/Enums/Scale.php | 4 +- .../Models/TypedProperties/UserTyped.php | 8 +-- .../Tests/Models/Upsertable/Insertable.php | 3 +- .../Tests/Models/Upsertable/Updatable.php | 3 +- .../ORM/Functional/DatabaseDriverTest.php | 4 +- .../ORM/Functional/DatabaseDriverTestCase.php | 4 +- .../Functional/ExtraLazyCollectionTest.php | 18 +++---- .../Tests/ORM/Functional/SQLFilterTest.php | 9 ++-- .../ORM/Functional/Ticket/DDC1301Test.php | 14 ++--- .../ORM/Functional/Ticket/DDC2387Test.php | 6 +-- .../ORM/Functional/Ticket/DDC2415Test.php | 8 +-- .../ORM/Functional/Ticket/DDC3103Test.php | 2 +- .../ORM/Functional/Ticket/GH6682Test.php | 4 +- .../ORM/Mapping/AbstractMappingDriverTest.php | 53 +++++++++---------- .../Tests/ORM/Mapping/FieldBuilderTest.php | 6 +-- .../ORM/Mapping/PHPMappingDriverTest.php | 2 +- .../php/Doctrine.Tests.Models.Cache.City.php | 14 ++--- ...e.Tests.Models.Company.CompanyContract.php | 4 +- ...1476.DDC1476EntityWithDefaultFieldType.php | 4 +- ...trine.Tests.Models.DDC3579.DDC3579User.php | 4 +- ...rine.Tests.Models.DDC869.DDC869Payment.php | 4 +- ...ctrine.Tests.Models.DDC889.DDC889Class.php | 2 +- ...e.Tests.Models.DDC889.DDC889SuperClass.php | 4 +- ...octrine.Tests.Models.DDC964.DDC964User.php | 4 +- ...Tests.Models.TypedProperties.UserTyped.php | 6 +-- ...ine.Tests.Models.Upsertable.Insertable.php | 6 +-- ...rine.Tests.Models.Upsertable.Updatable.php | 6 +-- .../php/Doctrine.Tests.ORM.Mapping.Animal.php | 10 ++-- .../Doctrine.Tests.ORM.Mapping.Comment.php | 4 +- ...ctrine.Tests.ORM.Mapping.DDC1170Entity.php | 4 +- ...octrine.Tests.ORM.Mapping.DDC807Entity.php | 4 +- .../php/Doctrine.Tests.ORM.Mapping.PHPSLC.php | 4 +- .../php/Doctrine.Tests.ORM.Mapping.User.php | 8 +-- .../AbstractClassMetadataExporterTest.php | 31 ++++++----- .../Export/XmlClassMetadataExporterTest.php | 3 +- .../Doctrine.Tests.ORM.Tools.Export.User.php | 16 +++--- .../Tests/ORM/Tools/SchemaToolTest.php | 5 +- 58 files changed, 190 insertions(+), 198 deletions(-) diff --git a/tests/Doctrine/Tests/Models/CMS/CmsAddress.php b/tests/Doctrine/Tests/Models/CMS/CmsAddress.php index d795725c127..3a3a8393a48 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsAddress.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsAddress.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Events; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\ColumnResult; use Doctrine\ORM\Mapping\Entity; @@ -157,7 +157,7 @@ public function setUser(CmsUser $user): void } } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->setPrimaryTable( ['name' => 'company_person'] diff --git a/tests/Doctrine/Tests/Models/CMS/CmsUser.php b/tests/Doctrine/Tests/Models/CMS/CmsUser.php index 549f6983000..8be17445e07 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsUser.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsUser.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\ColumnResult; use Doctrine\ORM\Mapping\Entity; @@ -336,7 +336,7 @@ public function setEmail(?CmsEmail $email = null): void } } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->setPrimaryTable( ['name' => 'cms_users'] diff --git a/tests/Doctrine/Tests/Models/Cache/City.php b/tests/Doctrine/Tests/Models/Cache/City.php index 7eea2889b62..bd2dc106e68 100644 --- a/tests/Doctrine/Tests/Models/Cache/City.php +++ b/tests/Doctrine/Tests/Models/Cache/City.php @@ -8,7 +8,7 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\Cache; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\GeneratedValue; @@ -136,7 +136,7 @@ public function getAttractions(): Collection return $this->attractions; } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { include __DIR__ . '/../../ORM/Mapping/php/Doctrine.Tests.Models.Cache.City.php'; } diff --git a/tests/Doctrine/Tests/Models/Company/CompanyContract.php b/tests/Doctrine/Tests/Models/Company/CompanyContract.php index e7081f3a925..0aa1318c8bd 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyContract.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyContract.php @@ -9,7 +9,6 @@ use Doctrine\ORM\Events; use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\DiscriminatorColumn; use Doctrine\ORM\Mapping\DiscriminatorMap; @@ -170,7 +169,7 @@ public function removeEngineer(CompanyEmployee $engineer): void abstract public function calculatePrice(): int; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_JOINED); $metadata->setTableName('company_contracts'); diff --git a/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php b/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php index 34571c889c5..13ef3b53f8d 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\Models\Company; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; @@ -36,7 +36,7 @@ public function setFixPrice($fixPrice): void $this->fixPrice = $fixPrice; } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php b/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php index b68b92f35ac..018221d4ecb 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\EntityResult; @@ -140,7 +140,7 @@ public function removeManager(CompanyManager $manager): void $this->managers->removeElement($manager); } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php b/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php index 211bec111ae..53e8595c179 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Events; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\EntityListeners; @@ -42,7 +42,7 @@ public function setMaxPrice(int $maxPrice): void $this->maxPrice = $maxPrice; } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/Models/Company/CompanyPerson.php b/tests/Doctrine/Tests/Models/Company/CompanyPerson.php index 6f6eefaa9a1..a4e43c747f4 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyPerson.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyPerson.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\DiscriminatorColumn; use Doctrine\ORM\Mapping\DiscriminatorMap; @@ -153,7 +153,7 @@ public function setSpouse(CompanyPerson $spouse): void } } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->setPrimaryTable( ['name' => 'company_person'] diff --git a/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php b/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php index 8345120b423..33ca8199fb8 100644 --- a/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php +++ b/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\Models\DDC1476; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\GeneratedValue; @@ -48,7 +48,7 @@ public function setName(string $name): void $this->name = $name; } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ @@ -60,6 +60,6 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ['fieldName' => 'name'] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); } } diff --git a/tests/Doctrine/Tests/Models/DDC3579/DDC3579User.php b/tests/Doctrine/Tests/Models/DDC3579/DDC3579User.php index a5daba7e68c..4d6c86a5b6e 100644 --- a/tests/Doctrine/Tests/Models/DDC3579/DDC3579User.php +++ b/tests/Doctrine/Tests/Models/DDC3579/DDC3579User.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\Models\DDC3579; use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\GeneratedValue; use Doctrine\ORM\Mapping\Id; @@ -105,6 +105,6 @@ public static function loadMetadata($metadata): void ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); } } diff --git a/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php b/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php index 1b5b335e49e..a89cb2304ce 100644 --- a/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php +++ b/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\Models\DDC869; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; @@ -22,7 +22,7 @@ class DDC869ChequePayment extends DDC869Payment #[ORM\Column(type: 'string')] protected $serialNumber; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php b/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php index 0edac07476a..0df07fbe05d 100644 --- a/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php +++ b/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\Models\DDC869; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; @@ -22,7 +22,7 @@ class DDC869CreditCardPayment extends DDC869Payment #[ORM\Column(type: 'string')] protected $creditCardNumber; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php b/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php index 26e1c6a2af7..6ade87d43f7 100644 --- a/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php +++ b/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\Models\DDC869; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\GeneratedValue; use Doctrine\ORM\Mapping\Id; @@ -33,7 +33,7 @@ class DDC869Payment #[ORM\Column(type: 'float')] protected $value; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ @@ -51,6 +51,6 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ); $metadata->isMappedSuperclass = true; $metadata->setCustomRepositoryClass(DDC869PaymentRepository::class); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); } } diff --git a/tests/Doctrine/Tests/Models/DDC889/DDC889Class.php b/tests/Doctrine/Tests/Models/DDC889/DDC889Class.php index 676af08ea38..c9533aa18c5 100644 --- a/tests/Doctrine/Tests/Models/DDC889/DDC889Class.php +++ b/tests/Doctrine/Tests/Models/DDC889/DDC889Class.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\Models\DDC889; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\GeneratedValue; use Doctrine\ORM\Mapping\Id; @@ -19,7 +19,7 @@ class DDC889Class extends DDC889SuperClass */ protected $id; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ @@ -30,6 +30,6 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); } } diff --git a/tests/Doctrine/Tests/Models/DDC889/DDC889Entity.php b/tests/Doctrine/Tests/Models/DDC889/DDC889Entity.php index 6aa7e500d14..eeb4b3bdadc 100644 --- a/tests/Doctrine/Tests/Models/DDC889/DDC889Entity.php +++ b/tests/Doctrine/Tests/Models/DDC889/DDC889Entity.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\Models\DDC889; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Entity; /** @@ -14,7 +14,7 @@ #[ORM\Entity] class DDC889Entity extends DDC889SuperClass { - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { } } diff --git a/tests/Doctrine/Tests/Models/DDC889/DDC889SuperClass.php b/tests/Doctrine/Tests/Models/DDC889/DDC889SuperClass.php index b9ca94f3908..7e8acc50fc3 100644 --- a/tests/Doctrine/Tests/Models/DDC889/DDC889SuperClass.php +++ b/tests/Doctrine/Tests/Models/DDC889/DDC889SuperClass.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\Models\DDC889; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\MappedSuperclass; @@ -22,13 +22,13 @@ class DDC889SuperClass #[ORM\Column] protected $name; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( ['fieldName' => 'name'] ); $metadata->isMappedSuperclass = true; - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); } } diff --git a/tests/Doctrine/Tests/Models/DDC964/DDC964Admin.php b/tests/Doctrine/Tests/Models/DDC964/DDC964Admin.php index 71bd1e74fbb..bcde2787862 100644 --- a/tests/Doctrine/Tests/Models/DDC964/DDC964Admin.php +++ b/tests/Doctrine/Tests/Models/DDC964/DDC964Admin.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping\AssociationOverride; use Doctrine\ORM\Mapping\AssociationOverrides; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\JoinColumn; use Doctrine\ORM\Mapping\JoinTable; @@ -32,7 +32,7 @@ #[AssociationOverrides([new AssociationOverride(name: 'groups', joinTable: new JoinTable(name: 'ddc964_users_admingroups'), joinColumns: [new JoinColumn(name: 'adminuser_id')], inverseJoinColumns: [new JoinColumn(name: 'admingroup_id')]), new AssociationOverride(name: 'address', joinColumns: [new JoinColumn(name: 'adminaddress_id', referencedColumnName: 'id')])])] class DDC964Admin extends DDC964User { - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->setAssociationOverride( 'address', diff --git a/tests/Doctrine/Tests/Models/DDC964/DDC964Guest.php b/tests/Doctrine/Tests/Models/DDC964/DDC964Guest.php index afe8a6c47ec..d5967dbec92 100644 --- a/tests/Doctrine/Tests/Models/DDC964/DDC964Guest.php +++ b/tests/Doctrine/Tests/Models/DDC964/DDC964Guest.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping\AttributeOverride; use Doctrine\ORM\Mapping\AttributeOverrides; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; @@ -34,7 +34,7 @@ #[AttributeOverrides([new AttributeOverride(name: 'id', column: new Column(name: 'guest_id', type: 'integer', length: 140)), new AttributeOverride(name: 'name', column: new Column(name: 'guest_name', nullable: false, unique: true, length: 240))])] class DDC964Guest extends DDC964User { - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->setAttributeOverride('id', [ 'columnName' => 'guest_id', diff --git a/tests/Doctrine/Tests/Models/DDC964/DDC964User.php b/tests/Doctrine/Tests/Models/DDC964/DDC964User.php index 9c2eb2ed48d..f3b477c96ca 100644 --- a/tests/Doctrine/Tests/Models/DDC964/DDC964User.php +++ b/tests/Doctrine/Tests/Models/DDC964/DDC964User.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\GeneratedValue; use Doctrine\ORM\Mapping\Id; @@ -107,7 +107,7 @@ public function setAddress(DDC964Address $address): void $this->address = $address; } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->isMappedSuperclass = true; @@ -164,6 +164,6 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); } } diff --git a/tests/Doctrine/Tests/Models/Enums/Card.php b/tests/Doctrine/Tests/Models/Enums/Card.php index 5cfcaad4273..bd533e090ee 100644 --- a/tests/Doctrine/Tests/Models/Enums/Card.php +++ b/tests/Doctrine/Tests/Models/Enums/Card.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\Models\Enums; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\GeneratedValue; @@ -28,7 +28,7 @@ class Card #[Column(type: 'string', enumType: Suit::class)] public $suit; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/Models/Enums/CardWithNullable.php b/tests/Doctrine/Tests/Models/Enums/CardWithNullable.php index ea35461a81e..81f991a7c60 100644 --- a/tests/Doctrine/Tests/Models/Enums/CardWithNullable.php +++ b/tests/Doctrine/Tests/Models/Enums/CardWithNullable.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\Models\Enums; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\GeneratedValue; @@ -28,7 +28,7 @@ class CardWithNullable #[Column(type: 'string', nullable: true, enumType: Suit::class)] public $suit; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/Models/Enums/Scale.php b/tests/Doctrine/Tests/Models/Enums/Scale.php index 45e56a00019..f101bc0c445 100644 --- a/tests/Doctrine/Tests/Models/Enums/Scale.php +++ b/tests/Doctrine/Tests/Models/Enums/Scale.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\Models\Enums; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\GeneratedValue; @@ -28,7 +28,7 @@ class Scale #[Column(type: 'simple_array', enumType: Unit::class)] public $supportedUnits; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/Models/TypedProperties/UserTyped.php b/tests/Doctrine/Tests/Models/TypedProperties/UserTyped.php index 2a4defddb31..ad5af325cf6 100644 --- a/tests/Doctrine/Tests/Models/TypedProperties/UserTyped.php +++ b/tests/Doctrine/Tests/Models/TypedProperties/UserTyped.php @@ -8,7 +8,7 @@ use DateTime; use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Embedded; use Doctrine\ORM\Mapping\Entity; @@ -82,9 +82,9 @@ class UserTyped #[ORM\Embedded] public ?Contact $contact = null; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { - $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); + $metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable( ['name' => 'cms_users_typed'] ); @@ -95,7 +95,7 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void 'fieldName' => 'id', ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/Models/Upsertable/Insertable.php b/tests/Doctrine/Tests/Models/Upsertable/Insertable.php index 3ebfc1a76ff..8747d3ca60e 100644 --- a/tests/Doctrine/Tests/Models/Upsertable/Insertable.php +++ b/tests/Doctrine/Tests/Models/Upsertable/Insertable.php @@ -5,7 +5,6 @@ namespace Doctrine\Tests\Models\Upsertable; use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\GeneratedValue; @@ -62,7 +61,7 @@ public static function loadMetadata(ClassMetadata $metadata): ClassMetadata 'fieldName' => 'nonInsertableContent', 'notInsertable' => true, 'options' => ['default' => '1234'], - 'generated' => ClassMetadataInfo::GENERATED_INSERT, + 'generated' => ClassMetadata::GENERATED_INSERT, ] ); $metadata->mapField( diff --git a/tests/Doctrine/Tests/Models/Upsertable/Updatable.php b/tests/Doctrine/Tests/Models/Upsertable/Updatable.php index bd793773512..37b4b62767e 100644 --- a/tests/Doctrine/Tests/Models/Upsertable/Updatable.php +++ b/tests/Doctrine/Tests/Models/Upsertable/Updatable.php @@ -5,7 +5,6 @@ namespace Doctrine\Tests\Models\Upsertable; use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\GeneratedValue; @@ -60,7 +59,7 @@ public static function loadMetadata(ClassMetadata $metadata): ClassMetadata [ 'fieldName' => 'nonUpdatableContent', 'notUpdatable' => true, - 'generated' => ClassMetadataInfo::GENERATED_ALWAYS, + 'generated' => ClassMetadata::GENERATED_ALWAYS, ] ); $metadata->mapField( diff --git a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php index 717a668618e..6b60c3f7909 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php @@ -9,7 +9,7 @@ use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Table; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use function array_change_key_case; use function count; @@ -117,7 +117,7 @@ public function testLoadMetadataWithForeignKeyFromDatabase(): void $bazMetadata->associationMappings = array_change_key_case($bazMetadata->associationMappings, CASE_LOWER); self::assertArrayHasKey('bar', $bazMetadata->associationMappings); - self::assertEquals(ClassMetadataInfo::MANY_TO_ONE, $bazMetadata->associationMappings['bar']['type']); + self::assertEquals(ClassMetadata::MANY_TO_ONE, $bazMetadata->associationMappings['bar']['type']); } public function testDetectManyToManyTables(): void diff --git a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTestCase.php b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTestCase.php index a7e580646d5..3f44040975d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTestCase.php +++ b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTestCase.php @@ -21,7 +21,7 @@ abstract class DatabaseDriverTestCase extends OrmFunctionalTestCase { /** - * @psalm-return array + * @psalm-return array */ protected function convertToClassMetadata(array $entityTables, array $manyTables = []): array { @@ -42,7 +42,7 @@ protected function convertToClassMetadata(array $entityTables, array $manyTables /** * @param string[] $classNames * - * @psalm-return array + * @psalm-return array */ protected function extractClassMetadata(array $classNames): array { diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index 12dd5f17fd4..bf39db8ca20 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Functional; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\Models\CMS\CmsArticle; use Doctrine\Tests\Models\CMS\CmsGroup; use Doctrine\Tests\Models\CMS\CmsPhonenumber; @@ -59,11 +59,11 @@ protected function setUp(): void parent::setUp(); $class = $this->_em->getClassMetadata(CmsUser::class); - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class->associationMappings['groups']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; $class->associationMappings['groups']['indexBy'] = 'name'; - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class->associationMappings['articles']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; $class->associationMappings['articles']['indexBy'] = 'topic'; - $class->associationMappings['phonenumbers']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class->associationMappings['phonenumbers']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; $class->associationMappings['phonenumbers']['indexBy'] = 'phonenumber'; foreach (['phonenumbers', 'articles', 'users'] as $field) { @@ -75,7 +75,7 @@ protected function setUp(): void } $class = $this->_em->getClassMetadata(CmsGroup::class); - $class->associationMappings['users']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class->associationMappings['users']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; $class->associationMappings['users']['indexBy'] = 'username'; $this->loadFixture(); @@ -86,9 +86,9 @@ public function tearDown(): void parent::tearDown(); $class = $this->_em->getClassMetadata(CmsUser::class); - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['phonenumbers']['fetch'] = ClassMetadataInfo::FETCH_LAZY; + $class->associationMappings['groups']['fetch'] = ClassMetadata::FETCH_LAZY; + $class->associationMappings['articles']['fetch'] = ClassMetadata::FETCH_LAZY; + $class->associationMappings['phonenumbers']['fetch'] = ClassMetadata::FETCH_LAZY; foreach (['phonenumbers', 'articles', 'users'] as $field) { if (isset($this->previousCacheConfig[$field])) { @@ -102,7 +102,7 @@ public function tearDown(): void unset($class->associationMappings['phonenumbers']['indexBy']); $class = $this->_em->getClassMetadata(CmsGroup::class); - $class->associationMappings['users']['fetch'] = ClassMetadataInfo::FETCH_LAZY; + $class->associationMappings['users']['fetch'] = ClassMetadata::FETCH_LAZY; unset($class->associationMappings['users']['indexBy']); } diff --git a/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php b/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php index c4ec569d290..5c767cca6e1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php @@ -9,7 +9,6 @@ use Doctrine\ORM\Configuration; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Query\Filter\FilterException; use Doctrine\ORM\Query\Filter\SQLFilter; use Doctrine\ORM\Query\FilterCollection; @@ -93,8 +92,8 @@ public function tearDown(): void parent::tearDown(); $class = $this->_em->getClassMetadata(CmsUser::class); - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_LAZY; + $class->associationMappings['groups']['fetch'] = ClassMetadata::FETCH_LAZY; + $class->associationMappings['articles']['fetch'] = ClassMetadata::FETCH_LAZY; } public function testConfigureFilter(): void @@ -589,8 +588,8 @@ public function testWhereOrFilter(): void private function loadLazyFixtureData(): void { $class = $this->_em->getClassMetadata(CmsUser::class); - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class->associationMappings['articles']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; + $class->associationMappings['groups']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; $this->loadFixtureData(); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php index 1fa7f783dd5..f3049476bcb 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\Models; use Doctrine\Tests\OrmFunctionalTestCase; @@ -23,9 +23,9 @@ protected function setUp(): void parent::setUp(); $class = $this->_em->getClassMetadata(Models\Legacy\LegacyUser::class); - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $class->associationMappings['references']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $class->associationMappings['cars']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class->associationMappings['articles']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; + $class->associationMappings['references']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; + $class->associationMappings['cars']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; $this->loadFixture(); } @@ -35,9 +35,9 @@ public function tearDown(): void parent::tearDown(); $class = $this->_em->getClassMetadata(Models\Legacy\LegacyUser::class); - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['references']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['cars']['fetch'] = ClassMetadataInfo::FETCH_LAZY; + $class->associationMappings['articles']['fetch'] = ClassMetadata::FETCH_LAZY; + $class->associationMappings['references']['fetch'] = ClassMetadata::FETCH_LAZY; + $class->associationMappings['cars']['fetch'] = ClassMetadata::FETCH_LAZY; } public function testCountNotInitializesLegacyCollection(): void diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2387Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2387Test.php index 8ac3c3c4f31..f3fbaa5cb3a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2387Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2387Test.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\DBAL\Schema\Table; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\ORM\Functional\DatabaseDriverTestCase; class DDC2387Test extends DatabaseDriverTestCase @@ -27,7 +27,7 @@ public function testCompositeAssociationKeyDetection(): void $metadata = $this->convertToClassMetadata([$product, $attributes], []); - self::assertEquals(ClassMetadataInfo::GENERATOR_TYPE_NONE, $metadata['Ddc2387Attributes']->generatorType); - self::assertEquals(ClassMetadataInfo::GENERATOR_TYPE_AUTO, $metadata['Ddc2387Product']->generatorType); + self::assertEquals(ClassMetadata::GENERATOR_TYPE_NONE, $metadata['Ddc2387Attributes']->generatorType); + self::assertEquals(ClassMetadata::GENERATOR_TYPE_AUTO, $metadata['Ddc2387Product']->generatorType); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php index e68dd582170..b99b56bdc7d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php @@ -6,7 +6,7 @@ use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Id\AbstractIdGenerator; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Driver\StaticPHPDriver; use Doctrine\Tests\OrmFunctionalTestCase; @@ -63,7 +63,7 @@ public function getId(): string return $this->id; } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ @@ -73,7 +73,7 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_CUSTOM); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM); $metadata->setCustomGeneratorDefinition(['class' => DDC2415Generator::class]); $metadata->isMappedSuperclass = true; @@ -95,7 +95,7 @@ public function getName(): string return $this->name; } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3103Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3103Test.php index 4906cdb44ba..caa252e7c99 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3103Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3103Test.php @@ -18,7 +18,7 @@ class DDC3103Test extends OrmFunctionalTestCase { /** - * @covers \Doctrine\ORM\Mapping\ClassMetadataInfo::__sleep + * @covers \Doctrine\ORM\Mapping\ClassMetadata::__sleep */ public function testIssue(): void { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6682Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6682Test.php index 63922eaa8f2..eb928fcb333 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6682Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6682Test.php @@ -4,7 +4,7 @@ namespace Doctrine\Test\ORM\Functional\Ticket; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\OrmFunctionalTestCase; final class GH6682Test extends OrmFunctionalTestCase @@ -20,7 +20,7 @@ public function testIssue(): void 'initialValue' => '', ]; - $classMetadataInfo = new ClassMetadataInfo('test_entity'); + $classMetadataInfo = new ClassMetadata('test_entity'); $classMetadataInfo->setSequenceGeneratorDefinition($parsedDefinition); self::assertSame( diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index 119ca451da6..40f11163816 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -10,7 +10,6 @@ use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadataFactory; -use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\CustomIdGenerator; use Doctrine\ORM\Mapping\DefaultNamingStrategy; @@ -556,7 +555,7 @@ public function testDefaultFieldType(): void self::assertEquals('id', $class->fieldMappings['id']['columnName']); self::assertEquals('name', $class->fieldMappings['name']['columnName']); - self::assertEquals(ClassMetadataInfo::GENERATOR_TYPE_NONE, $class->generatorType); + self::assertEquals(ClassMetadata::GENERATOR_TYPE_NONE, $class->generatorType); } /** @@ -1155,7 +1154,7 @@ public function testInsertableColumn(): void self::assertArrayHasKey('notInsertable', $mapping); self::assertArrayHasKey('generated', $mapping); - self::assertSame(ClassMetadataInfo::GENERATED_INSERT, $mapping['generated']); + self::assertSame(ClassMetadata::GENERATED_INSERT, $mapping['generated']); self::assertArrayNotHasKey('notInsertable', $metadata->getFieldMapping('insertableContent')); } @@ -1167,7 +1166,7 @@ public function testUpdatableColumn(): void self::assertArrayHasKey('notUpdatable', $mapping); self::assertArrayHasKey('generated', $mapping); - self::assertSame(ClassMetadataInfo::GENERATED_ALWAYS, $mapping['generated']); + self::assertSame(ClassMetadata::GENERATED_ALWAYS, $mapping['generated']); self::assertArrayNotHasKey('notUpdatable', $metadata->getFieldMapping('updatableContent')); } @@ -1289,16 +1288,16 @@ public function doStuffOnPostPersist(): void { } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { - $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); + $metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable( [ 'name' => 'cms_users', 'options' => ['foo' => 'bar', 'baz' => ['key' => 'val']], ] ); - $metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); + $metadata->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_DEFERRED_IMPLICIT); $metadata->addLifecycleCallback('doStuffOnPrePersist', 'prePersist'); $metadata->addLifecycleCallback('doOtherStuffOnPrePersistToo', 'prePersist'); $metadata->addLifecycleCallback('doStuffOnPostPersist', 'postPersist'); @@ -1333,7 +1332,7 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void $mapping = ['fieldName' => 'version', 'type' => 'integer']; $metadata->setVersionMapping($mapping); $metadata->mapField($mapping); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); $metadata->mapOneToOne( [ 'fieldName' => 'address', @@ -1458,9 +1457,9 @@ class UserIncorrectIndex */ public $email; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { - $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); + $metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable([]); $metadata->mapField( [ @@ -1517,9 +1516,9 @@ class UserIncorrectUniqueConstraint */ public $email; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { - $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); + $metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable([]); $metadata->mapField( [ @@ -1569,9 +1568,9 @@ abstract class Animal #[ORM\CustomIdGenerator(class: 'stdClass')] public $id; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_CUSTOM); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM); $metadata->setCustomGeneratorDefinition(['class' => 'stdClass']); } } @@ -1580,7 +1579,7 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void #[ORM\Entity] class Cat extends Animal { - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { } } @@ -1589,7 +1588,7 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void #[ORM\Entity] class Dog extends Animal { - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { } } @@ -1632,7 +1631,7 @@ public function getValue(): ?string return $this->value; } - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ @@ -1649,7 +1648,7 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); } } @@ -1673,7 +1672,7 @@ class DDC807Entity #[ORM\Id, ORM\Column(type: 'integer'), ORM\GeneratedValue(strategy: 'NONE')] public $id; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ @@ -1690,7 +1689,7 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); } } @@ -1726,9 +1725,9 @@ class Comment #[ORM\Column(type: 'text')] private $content; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { - $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); + $metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable( [ 'indexes' => [ @@ -1773,7 +1772,7 @@ class SingleTableEntityNoDiscriminatorColumnMapping #[ORM\Id, ORM\Column(type: 'integer'), ORM\GeneratedValue(strategy: 'NONE')] public $id; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ @@ -1782,7 +1781,7 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); } } @@ -1816,7 +1815,7 @@ class SingleTableEntityIncompleteDiscriminatorColumnMapping #[ORM\Id, ORM\Column(type: 'integer'), ORM\GeneratedValue(strategy: 'NONE')] public $id; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ @@ -1825,7 +1824,7 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); } } @@ -1856,7 +1855,7 @@ class ReservedWordInTableColumn #[ORM\Column(name: '`count`', type: 'integer')] public $count; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/ORM/Mapping/FieldBuilderTest.php b/tests/Doctrine/Tests/ORM/Mapping/FieldBuilderTest.php index c73a287ed00..cef9bbc723e 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/FieldBuilderTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/FieldBuilderTest.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\ORM\Mapping; use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\OrmTestCase; @@ -13,7 +13,7 @@ class FieldBuilderTest extends OrmTestCase { public function testCustomIdGeneratorCanBeSet(): void { - $cmBuilder = new ClassMetadataBuilder(new ClassMetadataInfo(CmsUser::class)); + $cmBuilder = new ClassMetadataBuilder(new ClassMetadata(CmsUser::class)); $fieldBuilder = $cmBuilder->createField('aField', 'string'); @@ -22,7 +22,7 @@ public function testCustomIdGeneratorCanBeSet(): void $fieldBuilder->build(); - self::assertEquals(ClassMetadataInfo::GENERATOR_TYPE_CUSTOM, $cmBuilder->getClassMetadata()->generatorType); + self::assertEquals(ClassMetadata::GENERATOR_TYPE_CUSTOM, $cmBuilder->getClassMetadata()->generatorType); self::assertEquals(['class' => 'stdClass'], $cmBuilder->getClassMetadata()->customGeneratorDefinition); } } diff --git a/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php index c29fa5e7c98..a3af0fd2d78 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php @@ -22,7 +22,7 @@ protected function loadDriver(): MappingDriver // Convert Annotation mapping information to PHP // Uncomment this code if annotations changed and you want to update the PHP code // for the same mapping information -// $meta = new \Doctrine\ORM\Mapping\ClassMetadataInfo("Doctrine\Tests\ORM\Mapping\Animal"); +// $meta = new \Doctrine\ORM\Mapping\ClassMetadata("Doctrine\Tests\ORM\Mapping\Animal"); // $driver = $this->createAnnotationDriver(); // $driver->loadMetadataForClass("Doctrine\Tests\ORM\Mapping\Animal", $meta); // $exporter = $cme->getExporter('php', $path); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Cache.City.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Cache.City.php index ef01fa46232..f6c221aebd6 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Cache.City.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Cache.City.php @@ -2,19 +2,19 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\Models\Cache\Attraction; use Doctrine\Tests\Models\Cache\State; use Doctrine\Tests\Models\Cache\Travel; -$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); +$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable(['name' => 'cache_city']); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_IDENTITY); -$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_IDENTITY); +$metadata->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_DEFERRED_IMPLICIT); $metadata->enableCache( [ - 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, + 'usage' => ClassMetadata::CACHE_USAGE_READ_ONLY, ] ); @@ -49,7 +49,7 @@ ] ); $metadata->enableAssociationCache('state', [ - 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, + 'usage' => ClassMetadata::CACHE_USAGE_READ_ONLY, ]); $metadata->mapManyToMany( @@ -69,5 +69,5 @@ ] ); $metadata->enableAssociationCache('attractions', [ - 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, + 'usage' => ClassMetadata::CACHE_USAGE_READ_ONLY, ]); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php index 842980e2203..05fb17f6bca 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php @@ -3,9 +3,9 @@ declare(strict_types=1); use Doctrine\ORM\Events; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; -$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_JOINED); +$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_JOINED); $metadata->setTableName('company_contracts'); $metadata->setDiscriminatorColumn( [ diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php index b7ff3b83491..b5cb3c585ae 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; $metadata->mapField( [ @@ -13,4 +13,4 @@ $metadata->mapField( ['fieldName' => 'name'] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579User.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579User.php index cccc0e494d5..de61bdbdfcf 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579User.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC3579.DDC3579User.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; $metadata->isMappedSuperclass = true; @@ -34,4 +34,4 @@ ] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php index 803dcbc4cd6..d394e02df35 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\Models\DDC869\DDC869PaymentRepository; $metadata->mapField( @@ -21,4 +21,4 @@ ); $metadata->isMappedSuperclass = true; $metadata->setCustomRepositoryClass(DDC869PaymentRepository::class); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Class.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Class.php index 0e0099321c3..06be2ffbadf 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Class.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Class.php @@ -11,4 +11,4 @@ ] ); -//$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +//$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889SuperClass.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889SuperClass.php index b01fa21a373..eba7378fd6c 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889SuperClass.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889SuperClass.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\Models\DDC889\DDC889SuperClass; $metadata->mapField( @@ -13,4 +13,4 @@ ); $metadata->isMappedSuperclass = true; $metadata->setCustomRepositoryClass(DDC889SuperClass::class); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964User.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964User.php index 736ff5b569d..0bd4cffc280 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964User.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964User.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; $metadata->isMappedSuperclass = true; @@ -59,4 +59,4 @@ ] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php index 0888a78d07d..fbdf9a3f54b 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.TypedProperties.UserTyped.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; -$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); +$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable( ['name' => 'cms_users_typed'] ); @@ -15,7 +15,7 @@ 'fieldName' => 'id', ] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); $metadata->mapField( [ diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Upsertable.Insertable.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Upsertable.Insertable.php index 403cdb2ef2e..42be971a2de 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Upsertable.Insertable.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Upsertable.Insertable.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; $metadata->setPrimaryTable( ['name' => 'insertable_column'] @@ -14,14 +14,14 @@ 'fieldName' => 'id', ] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); $metadata->mapField( [ 'fieldName' => 'nonInsertableContent', 'notInsertable' => true, 'options' => ['default' => '1234'], - 'generated' => ClassMetadataInfo::GENERATED_INSERT, + 'generated' => ClassMetadata::GENERATED_INSERT, ] ); $metadata->mapField( diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Upsertable.Updatable.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Upsertable.Updatable.php index 9fe2627c0e6..7a5746abda4 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Upsertable.Updatable.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Upsertable.Updatable.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; $metadata->setPrimaryTable( ['name' => 'updatable_column'] @@ -14,13 +14,13 @@ 'fieldName' => 'id', ] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); $metadata->mapField( [ 'fieldName' => 'nonUpdatableContent', 'notUpdatable' => true, - 'generated' => ClassMetadataInfo::GENERATED_ALWAYS, + 'generated' => ClassMetadata::GENERATED_ALWAYS, ] ); $metadata->mapField( diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php index c40b9b42aef..bdff936e09f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php @@ -2,12 +2,12 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\ORM\Mapping\Cat; use Doctrine\Tests\ORM\Mapping\Dog; -/** @var ClassMetadataInfo $metadata */ -$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE); +/** @var ClassMetadata $metadata */ +$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_SINGLE_TABLE); $metadata->setDiscriminatorColumn( [ 'name' => 'dtype', @@ -22,7 +22,7 @@ 'dog' => Dog::class, ] ); -$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); +$metadata->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_DEFERRED_IMPLICIT); $metadata->mapField( [ 'fieldName' => 'id', @@ -36,5 +36,5 @@ 'columnName' => 'id', ] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_CUSTOM); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM); $metadata->setCustomGeneratorDefinition(['class' => 'stdClass']); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php index 4c3f733427a..130f8953706 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; -$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); +$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable( [ 'indexes' => [ diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php index 397c4c85f00..213198f39cd 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; $metadata->mapField( [ @@ -19,4 +19,4 @@ ] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC807Entity.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC807Entity.php index ff2786400c8..6d4aead41e4 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC807Entity.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC807Entity.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; $metadata->mapField( [ @@ -18,4 +18,4 @@ ] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.PHPSLC.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.PHPSLC.php index a19b2da1b2c..52ecf622f37 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.PHPSLC.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.PHPSLC.php @@ -2,11 +2,11 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; $metadata->enableCache( [ - 'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY, + 'usage' => ClassMetadata::CACHE_USAGE_READ_ONLY, ] ); $metadata->mapManyToOne( diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php index 9c0a0fd2b27..72ece4e6ac2 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php @@ -2,16 +2,16 @@ declare(strict_types=1); -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\ORM\Mapping\Address; use Doctrine\Tests\ORM\Mapping\Group; use Doctrine\Tests\ORM\Mapping\Phonenumber; -$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); +$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable( ['name' => 'cms_users'] ); -$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); +$metadata->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_DEFERRED_IMPLICIT); $metadata->addLifecycleCallback('doStuffOnPrePersist', 'prePersist'); $metadata->addLifecycleCallback('doOtherStuffOnPrePersistToo', 'prePersist'); $metadata->addLifecycleCallback('doStuffOnPostPersist', 'postPersist'); @@ -52,7 +52,7 @@ $mapping = ['fieldName' => 'version', 'type' => 'integer']; $metadata->setVersionMapping($mapping); $metadata->mapField($mapping); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); $metadata->mapOneToOne( [ 'fieldName' => 'address', diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php b/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php index efebde29704..61658d767b4 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php @@ -12,7 +12,6 @@ use Doctrine\ORM\Events; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadataFactory; -use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\Driver\AnnotationDriver; use Doctrine\ORM\Mapping\Driver\XmlDriver; use Doctrine\ORM\Mapping\Driver\YamlDriver; @@ -137,7 +136,7 @@ public function testExportDirectoryAndFilesAreCreated(): void /** * @depends testExportDirectoryAndFilesAreCreated */ - public function testExportedMetadataCanBeReadBackIn(): ClassMetadataInfo + public function testExportedMetadataCanBeReadBackIn(): ClassMetadata { $type = $this->getType(); @@ -158,7 +157,7 @@ public function testExportedMetadataCanBeReadBackIn(): ClassMetadataInfo /** * @depends testExportedMetadataCanBeReadBackIn */ - public function testTableIsExported(ClassMetadataInfo $class): ClassMetadataInfo + public function testTableIsExported(ClassMetadata $class): ClassMetadata { self::assertEquals('cms_users', $class->table['name']); self::assertEquals( @@ -172,7 +171,7 @@ public function testTableIsExported(ClassMetadataInfo $class): ClassMetadataInfo /** * @depends testTableIsExported */ - public function testTypeIsExported(ClassMetadataInfo $class): ClassMetadataInfo + public function testTypeIsExported(ClassMetadata $class): ClassMetadata { self::assertFalse($class->isMappedSuperclass); @@ -182,9 +181,9 @@ public function testTypeIsExported(ClassMetadataInfo $class): ClassMetadataInfo /** * @depends testTypeIsExported */ - public function testIdentifierIsExported(ClassMetadataInfo $class): ClassMetadataInfo + public function testIdentifierIsExported(ClassMetadata $class): ClassMetadata { - self::assertEquals(ClassMetadataInfo::GENERATOR_TYPE_IDENTITY, $class->generatorType, 'Generator Type wrong'); + self::assertEquals(ClassMetadata::GENERATOR_TYPE_IDENTITY, $class->generatorType, 'Generator Type wrong'); self::assertEquals(['id'], $class->identifier); self::assertTrue(isset($class->fieldMappings['id']['id']) && $class->fieldMappings['id']['id'] === true); @@ -194,7 +193,7 @@ public function testIdentifierIsExported(ClassMetadataInfo $class): ClassMetadat /** * @depends testIdentifierIsExported */ - public function testFieldsAreExported(ClassMetadataInfo $class): ClassMetadataInfo + public function testFieldsAreExported(ClassMetadata $class): ClassMetadata { self::assertTrue(isset($class->fieldMappings['id']['id']) && $class->fieldMappings['id']['id'] === true); self::assertEquals('id', $class->fieldMappings['id']['fieldName']); @@ -240,7 +239,7 @@ public function testFieldsAreProperlySerialized(): void /** * @depends testFieldsAreExported */ - public function testOneToOneAssociationsAreExported(ClassMetadataInfo $class): ClassMetadataInfo + public function testOneToOneAssociationsAreExported(ClassMetadata $class): ClassMetadata { self::assertTrue(isset($class->associationMappings['address'])); self::assertEquals(Address::class, $class->associationMappings['address']['targetEntity']); @@ -254,7 +253,7 @@ public function testOneToOneAssociationsAreExported(ClassMetadataInfo $class): C self::assertFalse($class->associationMappings['address']['isCascadeMerge']); self::assertFalse($class->associationMappings['address']['isCascadeDetach']); self::assertTrue($class->associationMappings['address']['orphanRemoval']); - self::assertEquals(ClassMetadataInfo::FETCH_EAGER, $class->associationMappings['address']['fetch']); + self::assertEquals(ClassMetadata::FETCH_EAGER, $class->associationMappings['address']['fetch']); return $class; } @@ -271,7 +270,7 @@ public function testManyToOneAssociationsAreExported($class): void /** * @depends testOneToOneAssociationsAreExported */ - public function testOneToManyAssociationsAreExported(ClassMetadataInfo $class): ClassMetadataInfo + public function testOneToManyAssociationsAreExported(ClassMetadata $class): ClassMetadata { self::assertTrue(isset($class->associationMappings['phonenumbers'])); self::assertEquals(Phonenumber::class, $class->associationMappings['phonenumbers']['targetEntity']); @@ -284,7 +283,7 @@ public function testOneToManyAssociationsAreExported(ClassMetadataInfo $class): self::assertTrue($class->associationMappings['phonenumbers']['isCascadeMerge']); self::assertFalse($class->associationMappings['phonenumbers']['isCascadeDetach']); self::assertTrue($class->associationMappings['phonenumbers']['orphanRemoval']); - self::assertEquals(ClassMetadataInfo::FETCH_LAZY, $class->associationMappings['phonenumbers']['fetch']); + self::assertEquals(ClassMetadata::FETCH_LAZY, $class->associationMappings['phonenumbers']['fetch']); return $class; } @@ -292,7 +291,7 @@ public function testOneToManyAssociationsAreExported(ClassMetadataInfo $class): /** * @depends testOneToManyAssociationsAreExported */ - public function testManyToManyAssociationsAreExported(ClassMetadataInfo $class): ClassMetadataInfo + public function testManyToManyAssociationsAreExported(ClassMetadata $class): ClassMetadata { self::assertTrue(isset($class->associationMappings['groups'])); self::assertEquals(Group::class, $class->associationMappings['groups']['targetEntity']); @@ -310,7 +309,7 @@ public function testManyToManyAssociationsAreExported(ClassMetadataInfo $class): self::assertTrue($class->associationMappings['groups']['isCascadeRefresh']); self::assertTrue($class->associationMappings['groups']['isCascadeMerge']); self::assertTrue($class->associationMappings['groups']['isCascadeDetach']); - self::assertEquals(ClassMetadataInfo::FETCH_EXTRA_LAZY, $class->associationMappings['groups']['fetch']); + self::assertEquals(ClassMetadata::FETCH_EXTRA_LAZY, $class->associationMappings['groups']['fetch']); return $class; } @@ -318,7 +317,7 @@ public function testManyToManyAssociationsAreExported(ClassMetadataInfo $class): /** * @depends testManyToManyAssociationsAreExported */ - public function testLifecycleCallbacksAreExported(ClassMetadataInfo $class): ClassMetadataInfo + public function testLifecycleCallbacksAreExported(ClassMetadata $class): ClassMetadata { self::assertTrue(isset($class->lifecycleCallbacks['prePersist'])); self::assertCount(2, $class->lifecycleCallbacks['prePersist']); @@ -335,7 +334,7 @@ public function testLifecycleCallbacksAreExported(ClassMetadataInfo $class): Cla /** * @depends testLifecycleCallbacksAreExported */ - public function testCascadeIsExported(ClassMetadataInfo $class): ClassMetadataInfo + public function testCascadeIsExported(ClassMetadata $class): ClassMetadata { self::assertTrue($class->associationMappings['phonenumbers']['isCascadePersist']); self::assertTrue($class->associationMappings['phonenumbers']['isCascadeMerge']); @@ -350,7 +349,7 @@ public function testCascadeIsExported(ClassMetadataInfo $class): ClassMetadataIn /** * @depends testCascadeIsExported */ - public function testInversedByIsExported(ClassMetadataInfo $class): void + public function testInversedByIsExported(ClassMetadata $class): void { self::assertEquals('user', $class->associationMappings['address']['inversedBy']); } diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php b/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php index 4855ded1a1d..043a4ad7ae1 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php @@ -5,7 +5,6 @@ namespace Doctrine\Tests\ORM\Tools\Export; use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Tools\Export\Driver\XmlExporter; /** @@ -37,7 +36,7 @@ public function testSequenceGenerator(): void ] ); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_SEQUENCE); $metadata->setSequenceGeneratorDefinition( [ 'sequenceName' => 'seq_entity_test_id', diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/php/Doctrine.Tests.ORM.Tools.Export.User.php b/tests/Doctrine/Tests/ORM/Tools/Export/php/Doctrine.Tests.ORM.Tools.Export.User.php index 5e4ebc17e18..d2e56f837bb 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Export/php/Doctrine.Tests.ORM.Tools.Export.User.php +++ b/tests/Doctrine/Tests/ORM/Tools/Export/php/Doctrine.Tests.ORM.Tools.Export.User.php @@ -3,20 +3,20 @@ declare(strict_types=1); use Doctrine\ORM\Events; -use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\ORM\Tools\Export; use Doctrine\Tests\ORM\Tools\Export\AddressListener; use Doctrine\Tests\ORM\Tools\Export\GroupListener; use Doctrine\Tests\ORM\Tools\Export\UserListener; -$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); +$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_NONE); $metadata->setPrimaryTable( [ 'name' => 'cms_users', 'options' => ['engine' => 'MyISAM', 'foo' => ['bar' => 'baz']], ] ); -$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); +$metadata->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_DEFERRED_IMPLICIT); $metadata->addLifecycleCallback('doStuffOnPrePersist', Events::prePersist); $metadata->addLifecycleCallback('doOtherStuffOnPrePersistToo', Events::prePersist); $metadata->addLifecycleCallback('doStuffOnPostPersist', Events::postPersist); @@ -53,7 +53,7 @@ 'options' => ['unsigned' => true], ] ); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); +$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO); $metadata->mapManyToOne( [ 'fieldName' => 'mainGroup', @@ -78,7 +78,7 @@ ], ], 'orphanRemoval' => true, - 'fetch' => ClassMetadataInfo::FETCH_EAGER, + 'fetch' => ClassMetadata::FETCH_EAGER, ] ); $metadata->mapOneToOne( @@ -90,7 +90,7 @@ [0 => 'persist'], 'inversedBy' => null, 'orphanRemoval' => false, - 'fetch' => ClassMetadataInfo::FETCH_EAGER, + 'fetch' => ClassMetadata::FETCH_EAGER, ] ); $metadata->mapOneToMany( @@ -104,7 +104,7 @@ ], 'mappedBy' => 'user', 'orphanRemoval' => true, - 'fetch' => ClassMetadataInfo::FETCH_LAZY, + 'fetch' => ClassMetadata::FETCH_LAZY, 'orderBy' => ['number' => 'ASC'], ] @@ -113,7 +113,7 @@ [ 'fieldName' => 'groups', 'targetEntity' => Export\Group::class, - 'fetch' => ClassMetadataInfo::FETCH_EXTRA_LAZY, + 'fetch' => ClassMetadata::FETCH_EXTRA_LAZY, 'cascade' => [ 0 => 'remove', diff --git a/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php b/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php index 4dd7fcf0ad4..9c1763748d0 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php @@ -6,7 +6,6 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\Id; @@ -588,7 +587,7 @@ class IncorrectIndexByFieldEntity /** @var string */ public $fieldName; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [ @@ -627,7 +626,7 @@ class IncorrectUniqueConstraintByFieldEntity /** @var string */ public $fieldName; - public static function loadMetadata(ClassMetadataInfo $metadata): void + public static function loadMetadata(ClassMetadata $metadata): void { $metadata->mapField( [