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 target class attributes #1210
Add support for target class attributes #1210
Conversation
Added missing `getAttributes()` to `DefinedTargetClass`
…efinedTargetClass`. This will allow mocking undefined classes in php >= 8.2.
Added related test.
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'd love to be able to use this on a project I'm working on.
@davedevelopment @GrahamCampbell is this something that you would consider reviewing/merging? has tests thank you |
Thank you for this, I've not been able to replicate those test failures yet. |
Scratch that, hadn't pulled the branch down yet 🤣 |
library/Mockery/Generator/StringManipulation/Pass/ClassAttributesPass.php
Outdated
Show resolved
Hide resolved
Hi, I just wanted to apologize for the delay in reviewing your pull request. I'm going to rebase, finalize and merge this pull request to Thanks for your patience and for your contribution to the project! |
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
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.
Target is 1.6.0
because we're adding new functionality in a backward-compatible manner.
Thanks! |
Resolves #1209.
This PR adds support for target class attributes. The
#[\AllowDynamicProperties]
attribute is the most straightfoward way to resolve PHP 8.2 compatibility issue mentioned in #1209.Details
TargetClassInterface
UpdategetAttributes()
which returns an array of attributesDefinedTargetClass
to return an empty array.UndefinedTargetClass
to return\AllowDynamicProperties
👈 i.e. the fixAdded
ClassAttributesPass
StringManipulationGenerator
to use this pass.Test Updates
ClassAttributesPass