Zaphpa_Callback_Util::getCallback doesn't support inheritance
jeffpritchard opened this issue · comments
If the method you want to route to is an inherited method, the getCallback method will change the class from what you specified to the parent. This is caused by using ReflectionMethod to get the class name and method name after using it to see if the method is static or not. $method->class will return the class the method appears in, not the class you want to call it in.
Example:
class a {
function foo() {
$this->bar();
}
}
class b inherits a {
function bar() {
print 'routed!';
}
}
If I use Zaphpa to route to Array('b', 'foo'), getCallback with instantiate 'a' instead, and the code will fail.
Submitted pull request ( #16 ) with fix.