hookphp
hookphp copied to clipboard
Hook PHP objects magic calls
Hello,
Have you thought to allow to hook magic calls too? For example
\SciActive\Hook::addCallback('Test->__toString', -2, function(&$arguments, $name, &$object, &$function, &$data){
});
Would be triggered by print($obj);. Same for constructor, setters and getters, etc.
I haven't, but yeah, I could definitely do that.
Didn't mean to close that.
Cool, looking forward for it.
I've added the ability to hook jsonSerialize.