/** * Removes an interface. * * If the interface is passed as PhpInterface object, * the interface is also remove from the use statements. * * @param PhpInterface|string $interface interface or qualified name * @return $this */ public function removeInterface($interface) { if ($interface instanceof PhpInterface) { $name = $interface->getName(); $qname = $interface->getQualifiedName(); $this->removeUseStatement($qname); } else { $name = $interface; } $index = array_search($name, $this->interfaces); if ($index) { unset($this->interfaces[$name]); } return $this; }
/** * Removes an interface. * * If the interface is passed as PhpInterface object, * the interface is also remove from the use statements. * * @param PhpInterface|string $interface interface or qualified name * @return $this */ public function removeInterface($interface) { if ($interface instanceof PhpInterface) { $name = $interface->getName(); $qname = $interface->getQualifiedName(); $this->removeUseStatement($qname); } else { $name = $interface; } $this->interfaces->remove($name); return $this; }