Skip to content

Commit

Permalink
Basic bug in the latest fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antecedent committed Mar 22, 2017
1 parent 0208615 commit 67802dc
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/CallRerouting.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,19 +437,21 @@ function connectDefaultInternals()
# and not directly call_user_func itself (or usort, or any other of those).
# We must compensate for scope that is lost, and that callback-taking functions
# can make use of.
if ($class === 'self' || $class === 'static' || $class === 'parent') {
# We do not discriminate between early and late static binding here: FIXME.
$actualClass = $caller['class'];
if ($class === 'parent') {
$actualClass = get_parent_class($actualClass);
if (!empty($class)) {
if ($class === 'self' || $class === 'static' || $class === 'parent') {
# We do not discriminate between early and late static binding here: FIXME.
$actualClass = $caller['class'];
if ($class === 'parent') {
$actualClass = get_parent_class($actualClass);
}
$class = $actualClass;
}
$class = $actualClass;
$reflection = new \ReflectionMethod($class, $method);
$reflection->setAccessible(true);
$args[$offset] = function() use ($reflection, $instance) {
return $reflection->invokeArgs($instance, func_get_args());
};
}
$reflection = new \ReflectionMethod($class, $method);
$reflection->setAccessible(true);
$args[$offset] = function() use ($reflection, $instance) {
return $reflection->invokeArgs($instance, func_get_args());
};
}
# Give the inspected arguments back to the callback-taking function
return relay($args);
Expand Down

0 comments on commit 67802dc

Please sign in to comment.