schmittjoh / serializer

Library for (de-)serializing data of any complexity (supports JSON, and XML)
http://jmsyst.com/libs/serializer
MIT License
2.32k stars 589 forks source link

Create an attribute driver decoupled from the annotations driver, deprecate the annotation based attribute reader #1469

Closed mbabker closed 1 year ago

mbabker commented 1 year ago
Q A
Bug fix? no
New feature? yes
Doc updated yes/no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #1452
License MIT

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)

goetas commented 1 year ago

whoa, this is cool :)

goetas commented 1 year ago

this is nice :)

thanks!