public function addInterface($interface)
{
$interfaceName = $interface;
if ($interface instanceof ReflectionClass) {
if (!$interface->isInterface()) {
throw new \InvalidArgumentException("Interface expected to add");
}
$interfaceName = $interface->name;
}
// Use absolute namespace to prevent NS-conflicts
$this->interfaces[] = '\\' . ltrim($interfaceName, '\\');
}