Skip to content
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

Removed ReflectionProperty::getAst() to prevent memory leaks #1216

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

kukulich
Copy link
Collaborator

Another part of #1073

I made ReflectionProperty cloneable because it was the most easy way. I've found issue #61 but I'm not sure if it's still relevant. Is it not enough that adapters are not cloneable ?

Btw there are already some classes that are cloneable, eg. ReflectionConstant or ReflectionEnumCase.

src/Reflection/ReflectionProperty.php Outdated Show resolved Hide resolved
src/Reflection/ReflectionProperty.php Outdated Show resolved Hide resolved
src/Reflection/ReflectionProperty.php Show resolved Hide resolved
@Ocramius
Copy link
Member

I made ReflectionProperty cloneable because it was the most easy way. I've found issue #61 but I'm not sure if it's still relevant. Is it not enough that adapters are not cloneable ?

Yeah, I think the restriction was in place due to shared mutable internal state: removal of the AST should fix that.

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢

Thanks @kukulich!

@Ocramius Ocramius removed the bug label Sep 22, 2022
@Ocramius Ocramius merged commit 054b4a3 into Roave:6.0.x Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants