Make dependency doctrine/annotations optional
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).
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)?
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 :)