Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ awareness about deprecated code.

# Upgrade to 4.3

## `Doctrine\Persistence\Mapping\AbstractClassMetadataFactory` is considered internal to Doctrine projects

This class now explicitly is an internal, shared implementation detail of Doctrine projects. Extending
or type-hinting it outside of Doctrine projects is not supported. Clients should refer to the `ClassMetadataFactory`
interface or more specific sub-interfaces or sub-classes from individual Doctrine projects only.

## Deprecated `ClassMetadataFactory::hasMetadataFor()`

The method `Doctrine\Persistence\Mapping\ClassMetadataFactory::hasMetadataFor()` is
Expand Down
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ parameters:
-
message: '#Class Foo not found#'
path: 'tests/Mapping/ClassMetadataFactoryTest.php'

# Sealed classes that we want to declare without installing the packages, and for which we don't want to expose test classes
-
message: '~^PHPDoc tag @phpstan-sealed contains unknown class~'
path: src/Mapping/AbstractClassMetadataFactory.php
-
message: '~^Type .* is not allowed to be a subtype of .*~'
path: tests/
7 changes: 7 additions & 0 deletions src/Mapping/AbstractClassMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
*
* This class was abstracted from the ORM ClassMetadataFactory.
*
* @internal since doctrine/persistence 4.3.0: This class is considered an
* implementation detail of Doctrine projects (ORM, PHPCR-ODM and MongoDB-ODM) and should not
* be extended or type-hinted by other clients. It may change or be removed without further
* notice.
*
* @psalm-inheritors Doctrine\ORM\Mapping\ClassMetadataFactory|Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory|Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory
* @phpstan-sealed Doctrine\ORM\Mapping\ClassMetadataFactory|Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory|Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory
* @template CMTemplate of ClassMetadata
* @template-implements ClassMetadataFactory<CMTemplate>
*/
Expand Down