Hateoas icon indicating copy to clipboard operation
Hateoas copied to clipboard

Make dependency doctrine/annotations optional

Open W0rma opened this issue 1 year ago • 2 comments

Since https://github.com/willdurand/Hateoas/pull/326 native PHP attributes can be used for configuration.

When using PHP 8.1 or greater PHP attributes can fully replace Doctrine annotations.

Thus, we could think about making the doctrine/annotations dependency optional (see https://github.com/willdurand/Hateoas/pull/326#issuecomment-2162562847).

W0rma avatar Oct 15 '24 10:10 W0rma

Making the annotations package optional is a BC break because packages which use Doctrine annotations for configuration would need to install doctrine/annotations explicitly.

In jms/serializer a similar change was released in a minor release (https://github.com/schmittjoh/serializer/pull/1471).

@goetas Should we use a similar strategy for willdurand/hateoas or would you prefer to work on that for the next major release (which could maybe even drop annotations completely while raising the minimum required PHP version to 8.1)?

W0rma avatar Oct 15 '24 11:10 W0rma

I'm fine in doing something as in jms serializer. a small bc break but it allows us to move forward. for sure some people will complain, but i will be happier without having to worry about it for the next years :)

goetas avatar Oct 15 '24 19:10 goetas