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

Prevent caching of delegate closures #156

Merged
merged 1 commit into from
Apr 7, 2017
Merged

Prevent caching of delegate closures #156

merged 1 commit into from
Apr 7, 2017

Conversation

shadowhand
Copy link
Contributor

Two different closures using the same parameter name should not end up
with the same parameters.

Two different closures using the same parameter name should not end up
with the same parameters.
@@ -75,7 +75,7 @@ public function getParamTypeHint(\ReflectionFunctionAbstract $function, \Reflect
$paramCacheKey = self::CACHE_KEY_CLASSES . "{$lowClass}.{$lowMethod}.param-{$lowParam}";
} else {
$lowFunc = strtolower($function->name);
$paramCacheKey = ($lowFunc !== '{closure}')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This match only works with closures defined outside of all namespace. It seems like the original intent was to exclude all closures, which makes sense.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Correct, thanks a lot for catching and fixing :-)

Copy link
Contributor Author

@shadowhand shadowhand Apr 7, 2017

Choose a reason for hiding this comment

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

@bwoebi would it be possible to have this tagged in a release? I've got some code that is using funky param names to avoid this bug.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I'm up to, just not done yet.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Tagged v1.4.1.

@bwoebi bwoebi merged commit c6c92ec into rdlowrey:master Apr 7, 2017
@shadowhand shadowhand deleted the fix/never-cache-closure-params branch April 7, 2017 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants