-
Notifications
You must be signed in to change notification settings - Fork 59
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
willdurand/Hateoas#325 support for php attributes #104
Conversation
Is anyone handling this PR? |
|
||
if (PHP_VERSION_ID >= 80100 && class_exists(AttributeReader::class)) { | ||
$container->register('hateoas.metadata.annotation_and_attributes_reader', AttributeReader::class) | ||
->setArgument(0, new Reference('annotation_reader')); |
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 service "annotation_reader" has been removed as of symfony/framework-bundle:^7.0
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.
I've refactored the way the new AttributeDriver
is configured in the bundle along with the annotation driver.
For this issue in particular, I've created a new private service hateoas.configuration.metadata.annotation_reader
to provide Doctrine\Common\Annotations\AnnotationReader
as a short-term solution.
Since willdurand/hateoas
requires doctrine/annotations
as a root package, it should be safe to create the service "hateoas.configuration.metadata.annotation_reader" definition.
Also, I would say the annotation driver should be marked as deprecated (I saw JMS did it), but I am not sure if you want to do the same.
fba3717
to
f085fc6
Compare
any new about this PR? |
Hello everyone, I have developed a catalog of micro services that are using this great bundle and I recently migrated all annotations to php8 attributes except hateoas because it is still not available. If it is necessary I can apply any requested changes to this PR, I have 1-2 month availability to contribute. |
Hi @jeandonaldroselin , I am still waiting for the final review by the maintainers. Nonetheless, I appreciate any suggestions that may improve the code. Thank you kindly |
I'm really sorry if this took so long. I have merged willdurand/Hateoas#326 and tagged https://github.com/willdurand/Hateoas/releases/tag/3.11.0-beta1 Can someone please rebase this pull request? |
update bundle based on hateoas changes
4aa8bbe
to
b86f876
Compare
Hi @goetas |
So, I see a lot of test failing. if it helps, i'm fine with requiring php ^8.1 and willdurand/Hateoas |
I will try to fix the tests this evening. I will reach out to you again in case I am unable to fix them. To be honest, my intention was not to be disruptive with the php version. |
Hi @goetas I believe this would be ready for a new try. Thanks |
To me looks good. I'm going to merge it and to tag a beta release. Please ping me here again after some time so I tag a stable release if there will be no problems. The ci failures are unrelated to your changes |
Great, I'll try the beta release on sylius resource package. Thx a lot |
@goetas I don't think that the failures are unrelated. The tests with PHP 8.0 fail because this PHP version knows about attributes but does not support nested attributes which are used by the test fixtures. I encountered a similar issue when working on willdurand/Hateoas#334 The simplest solution to fix that would be to drop support for PHP < 8.1. WDYT? |
@loic425 did you try the beta ? |
The configuration is ok, but the result is different here, any idea? |
@loic425 Did you also try the latest beta https://github.com/willdurand/Hateoas/releases/tag/3.12.0-beta1 together with #110 ? Especially willdurand/Hateoas@b3b5da5 is important to make |
@loic425 great! thanks for letting me know! @W0rma are you available anywhere for a chat regarding the recent changes you did? you can contact me via any of the possible ways listed on my profile https://github.com/goetas |
Adds a new service
hateoas.configuration.metadata.attribute_driver
for theAttributeDriver
class (willdurand/Hateoas#326)Moreover,
hateoas.configuration.metadata.attribute_driver
andhateoas.configuration.metadata.annotation_driver
are combined in a new servicehateoas.configuration.metadata.annotation_or_attribute_driver
to give the extension feature to both services.The
hateoas.configuration.metadata.attribute_driver
will be removed if the PHP version is prior 8.1.0, so thehateoas.configuration.metadata.annotation_or_attribute_driver
will have only the annotation driver.This PR will require a new release version of
willdurand/Hateoas