public function linkedTo(string $variable = null, array $labels = []): self
    {
        $clause = $this->clauses->last();

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

        $clause = $clause->linkedTo($variable, $labels);
        $query = new self;
        $query->clauses = $this
            ->clauses
            ->dropEnd(1)
            ->add($clause);

        return $query;
    }
public function linkedTo(string $variable = null, array $labels = []): self
    {
        $clause = $this->clauses->last();

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

        $clause = $clause->linkedTo($variable, $labels);
        $query = new self;
        $query->clauses = $this
            ->clauses
            ->dropEnd(1)
            ->add($clause);

        return $query;
    }
public function linkedTo ( string $ variable = null , array $ labels = [ ] ) : self { $ clause = $ this -> clauses -> last ( ) ; if ( ! $ clause instanceof Clause \ PathAware ) { throw new NonPathAwareClause ; } $ clause = $ clause -> linkedTo ( $ variable , $ labels ) ; $ query = new self ; $ query -> clauses = $ this -> clauses -> dropEnd ( 1 ) -> add ( $ clause ) ; return $ query ; }
Match the node linked to the previous declared node match

@param string $variable
@param array $labels

@throws NonPathAwareClause

@return self
Match the node linked to the previous declared node match