Skip to content

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