Open SimonTod opened 10 months ago
I fixed the issue with the next syntax :
use JMS\Serializer\Annotation\AccessType;
#[AccessType(type: 'public_method')]
class User { }
I think it would be a good thing to update the documentation
Thanks for feedback! I think it is time to make docs Attributes first :)
There is a small section about it : Converting your annotations to attributes
As declared in the documentation, the next annotation works
But I could not make it work using the php attribute
Error thrown :
As we can see in https://github.com/schmittjoh/serializer/blob/master/src/Annotation/AccessType.php#L24 :