-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for non type-hinted attribute accessors with no backed property #1411
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
Add support for non type-hinted attribute accessors with no backed property #1411
Conversation
Because of how the branches are now rebased on top of each other, this PR also includes #1339. |
7be808a
to
99e28aa
Compare
99e28aa
to
7bc77e3
Compare
Thank you for your work on this one. I'm not sure if I understand the status of this PR correctly. Is it still pending a final approval? |
We're still waiting on @mfn to review this PR. For context, this is a resubmission of a PR originally submitted april 2022. I have since moved on to using Laravel Idea, which also has Laravel IDE Helper like functionality. |
Hey @mfn - can we get this merged? |
(added) I tried I do not want to reference |
I have given up on waiting for this and have stopped using this package in favour of the Laravel IDEA plugin. |
Sorry for the delay here. Not sure why Psalm thinks it's dead code. I think the type can also be ReflectionNamedType or ReflectionUnionType according to https://www.php.net/manual/en/class.reflectiontype.php |
…operty (barryvdh#1411) * Read Attribute type from parameter * Update CHANGELOG.md * Update ModelsCommand.php --------- Co-authored-by: Barry vd. Heuvel <[email protected]> Co-authored-by: Barry vd. Heuvel <[email protected]>
Summary
This is a resubmission of #1338 as that got closed inadvertently.
Even though the documentation doesn't state this explicitly at the time of writing, it is possible to use the new Attribute accessor to create a calculated property where there is no backing property.
This solves #1315.
I added a check for if the Attribute accessor function has no specified type, and then add it without type.
Type of change
Checklist
composer fix-style