gossi\codegen\model\parts\InterfacesPart::addInterface PHP Method

addInterface() public method

If the interface is passed as PhpInterface object, the interface is also added as use statement.
public addInterface ( PhpInterface | string $interface )
$interface gossi\codegen\model\PhpInterface | string interface or qualified name
    public function addInterface($interface)
    {
        if ($interface instanceof PhpInterface) {
            $name = $interface->getName();
            $qname = $interface->getQualifiedName();
            $namespace = $interface->getNamespace();
            if ($namespace != $this->getNamespace()) {
                $this->addUseStatement($qname);
            }
        } else {
            $name = $interface;
        }
        $this->interfaces->add($name);
        return $this;
    }