public function getSignature($name)
{
if ($name === '__set') {
return 'function __set($key, $value)';
}
if ($name === '__call') {
return 'function __call($method, $arguments)';
}
if ($name === '__get') {
return 'function __get($key)';
}
if ($name === '__isset') {
return 'function __isset($key)';
}
if ($name === '__unset') {
return 'function __unset($key)';
}
if ($name === '__toString') {
return 'function __toString()';
}
/**
* @todo
* 1) This wonky try-catch is a work around for a faulty method_exists()
* in early versions of PHP 5 which would return false for static methods.
* 2) The Reflection classes work fine, but hasMethod() doesn't exist prior to PHP 5.1.0,
* so we need to use a more crude detection method.
*/
try {
$interface = new ReflectionClass($this->interface);
$interface->getMethod($name);
} catch (ReflectionException $e) {
return "function {$name}()";
}
return $this->getFullSignature($name);
}