As suggested with https://github.com/schmittjoh/serializer/issues/1452#issuecomment-1377511748 this makes a new base driver class for annotations and attributes, moves the loadMetadataForClass() method to that base class for reuse by child objects, and declares methods for child classes to handle loading whatever's needed. The current attribute reader (which implements the Annotations Reader interface) which is used as a decorator around an annotations reader for use inside the annotations driver is deprecated in favor of the new attributes driver.
(By design, the first commit here is a rename to try and retain the file history, otherwise doing it all in one go (rightfully) treats AnnotationOrAttributeDriver.php as a new file and the blame history gets really ugly; the commits individually show the moves right, even if GitHub's PR viewer doesn't)
As suggested with https://github.com/schmittjoh/serializer/issues/1452#issuecomment-1377511748 this makes a new base driver class for annotations and attributes, moves the
loadMetadataForClass()
method to that base class for reuse by child objects, and declares methods for child classes to handle loading whatever's needed. The current attribute reader (which implements the AnnotationsReader
interface) which is used as a decorator around an annotations reader for use inside the annotations driver is deprecated in favor of the new attributes driver.(By design, the first commit here is a rename to try and retain the file history, otherwise doing it all in one go (rightfully) treats
AnnotationOrAttributeDriver.php
as a new file and the blame history gets really ugly; the commits individually show the moves right, even if GitHub's PR viewer doesn't)