/*! @var object The object to which this interface is bound. */
private $object = NULL;
+ /*! @var ReflectionClass The reflector of #object. */
+ private $object_reflector = NULL;
+
/*! @var bool Whether or not a NULL object will throw when called. */
private $null_allowed = FALSE;
{
$this->_CheckObject($object);
$this->object = $object;
+ $this->object_reflector = new \ReflectionClass($this->object);
}
/*! Magic method that performs the actual method invocation. */
return;
}
- return $this->imps[$meth]->Invoke($args);
+ return $this->imps[$meth]->Invoke($this->object_reflector, $args);
}
/*! Ensures that the bound object properly implements the interface. */
}
/*! Forwards a method call. */
- public function Invoke($args)
+ public function Invoke($reflector, $args)
{
- $reflector = new \ReflectionClass($this->interface->get());
try {
$impl = $reflector->GetMethod($this->method->name);
} catch (\ReflectionException $e) {