protected function addEdges(string $direction, ...$classes): self
    {
        if(!in_array($direction, ["incoming", "outgoing"])) {
            // log meaningless direction
            return $this;
        }
        $var = sprintf("%s_edges", $direction);
        foreach($classes as $class) {
            if(in_array($class, $this->$var))
                continue;
            $this->$var[] = $class;
            $this->emit("edge.registered", [$direction, $class]);
            $this->emit($direction."_edge.registered", [$class]);
        }
        return $this;
    }
protected function addEdges(string $direction, ...$classes): self
    {
        if(!in_array($direction, ["incoming", "outgoing"])) {
            // log meaningless direction
            return $this;
        }
        $var = sprintf("%s_edges", $direction);
        foreach($classes as $class) {
            if(in_array($class, $this->$var))
                continue;
            $this->$var[] = $class;
            $this->emit("edge.registered", [$direction, $class]);
            $this->emit($direction."_edge.registered", [$class]);
        }
        return $this;
    }
protected function addEdges ( string $ direction , ... $ classes ) : self { if ( ! in_array ( $ direction , [ "incoming" , "outgoing" ] ) ) { // log meaningless direction return $ this ; } $ var = sprintf ( "%s_edges" , $ direction ) ; foreach ( $ classes as $ class ) { if ( in_array ( $ class , $ this -> $ var ) ) continue ; $ this -> $ var [ ] = $ class ; $ this -> emit ( "edge.registered" , [ $ direction , $ class ] ) ; $ this -> emit ( $ direction . "_edge.registered" , [ $ class ] ) ; } return $ this ; }
A helper method to register edges

@param string $direction Either incoming or outgoing
@param  ...$classes

@return self
A helper method to register edges