-
Notifications
You must be signed in to change notification settings - Fork 74
Allow use attribute instead of annotation #117
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
Conversation
3ddbe0c
to
bccf377
Compare
I Organized the commit history from the previous PR. |
Thanks @ggg-mzkr, lots of tidy up stuff here! And nice one implementing the php 8 specificity for the attributes. One question, for someone to migrate from annotations to attributes, is it expected that they'll need to add the use statements for the various attribute classes being used? It doesn't seem obvious from the readme that these would also need to be added. It'll only trip up people migrating, and only because they'll be used to not needing to include them due to the autoloading done in the background. Not saying ones right or wrong, just noting the difference. @szeber would you mind taking a look at this, seeing as you looked at the previous iteration? |
@ggg-mzkr thanks for your patience. I was hoping to get a second pair of eyes across this, but it's proving tricky. I'll get this sorted this week though! |
Looks like travis ci has finally been disconnected, and I don't have the perms to change how the tests run. So just noting that I've run them all manually for php 7.3, 7.4 and 8.0 |
@ggg-mzkr I finally got there! Thanks for your patience, and thanks so much for your contribution! 🙌 |
Allow use attribute instead of annotation.
Implementation design
AnnotationScanner
into the base scanner and annotation-dependent parts as ScanStrategy. And check pass the existing tests.AttributeScanStrategy
and test that the scan results are the same as theAnnotationScanStrategy
.AnnotationsServiceProvider
to allow to switch strategies.ex)
Annotation
Attribute
If use attribute, set
$useAttribute
totrue
inAnnotationsServiceProvider.php
;