-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate the Annotation
interface
#10178
Deprecate the Annotation
interface
#10178
Conversation
ef380ae
to
ead2f90
Compare
@@ -39,6 +39,8 @@ | |||
<referencedClass name="Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand"/> | |||
<referencedClass name="Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper"/> | |||
<referencedClass name="Doctrine\ORM\Tools\Console\EntityManagerProvider\HelperSetManagerProvider"/> | |||
<!-- https://github.com/vimeo/psalm/issues/8617 --> | |||
<referencedClass name="Doctrine\ORM\Mapping\Annotation"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface is reported as a class when used in generics. I've created vimeo/psalm#8617 to track this issue.
namespace Doctrine\ORM\Mapping; | ||
|
||
/** A marker interface for mapping attributes. */ | ||
interface MappingAttribute extends Annotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you name it MappingAttribute
and not just Attribute
? It is already inside a Mapping
namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because literally all classes that implement this interface also have an attribute attached to them named Attribute
and I didn't want to screw up the imports everywhere. I also wanted the name of the marker interface to be a bit more specific. After all, it's not just an arbitrary attribute, it's one that we use to configure mapping information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thanks!
* 2.14.x: Deprecate the Annotation interface (doctrine#10178) Bump CI to PHP 8.2 and latest database versions (doctrine#10180) Remove reference to deprecated DriverChain from docs (doctrine#10179)
Once we remove the support for annotations, having a marker interface named
Annotation
for our attribute classes seems weird. Let's rename it.