public function through(
        string $type,
        string $variable = null,
        string $direction = 'BOTH'
    ): self {
        $clause = $this->clauses->last();

        if (!$clause instanceof Clause\PathAware) {
            throw new NonPathAwareClause;
        }

        $clause = $clause->through($variable, $type, $direction);
        $query = new self;
        $query->clauses = $this
            ->clauses
            ->dropEnd(1)
            ->add($clause);

        return $query;
    }
public function through(
        string $type,
        string $variable = null,
        string $direction = 'BOTH'
    ): self {
        $clause = $this->clauses->last();

        if (!$clause instanceof Clause\PathAware) {
            throw new NonPathAwareClause;
        }

        $clause = $clause->through($variable, $type, $direction);
        $query = new self;
        $query->clauses = $this
            ->clauses
            ->dropEnd(1)
            ->add($clause);

        return $query;
    }
public function through ( string $ type , string $ variable = null , string $ direction = 'BOTH' ) : self { $ clause = $ this -> clauses -> last ( ) ; if ( ! $ clause instanceof Clause \ PathAware ) { throw new NonPathAwareClause ; } $ clause = $ clause -> through ( $ variable , $ type , $ direction ) ; $ query = new self ; $ query -> clauses = $ this -> clauses -> dropEnd ( 1 ) -> add ( $ clause ) ; return $ query ; }
Specify the type of relationship for the last match clause

@param string $type
@param string $variable
@param string $direction

@throws NonPathAwareClause

@return self
Specify the type of relationship for the last match clause