public static function create(string $name = 'G', bool $directional = true): self
    {
        $graph = new self();
        $graph
            ->setName($name)
            ->setType($directional ? 'digraph' : 'graph');

        return $graph;
    }
public static function create(string $name = 'G', bool $directional = true): self
    {
        $graph = new self();
        $graph
            ->setName($name)
            ->setType($directional ? 'digraph' : 'graph');

        return $graph;
    }
public static function create ( string $ name = 'G' , bool $ directional = true ) : self { $ graph = new self ( ) ; $ graph -> setName ( $ name ) -> setType ( $ directional ? 'digraph' : 'graph' ) ; return $ graph ; }
Factory method to instantiate a Graph so that you can use fluent coding
to chain everything.

@param string $name        The name for this graph.
@param bool   $directional Whether this is a directed or undirected graph.

@return \phpDocumentor\GraphViz\Graph
Factory method to instantiate a Graph so that you can use fluent coding to chain everything .