Code Duplication    Length = 6-6 lines in 2 locations

src/Parser/Tokens.php 2 locations

@@ 53-58 (lines=6) @@
50
        return $key;
51
    }
52
53
    public function from($tokenType, $inclusive = false) {
54
        $key = $this->getKeyToSlice($tokenType);
55
        if ($key === false) return new Tokens([]);
56
        if (!$inclusive) $key++;
57
        return new Tokens(array_slice($this->tokens, $key));
58
    }
59
60
    public function to($tokenType, $inclusive = false) {
61
        $key = $this->getKeyToSlice($tokenType);
@@ 60-65 (lines=6) @@
57
        return new Tokens(array_slice($this->tokens, $key));
58
    }
59
60
    public function to($tokenType, $inclusive = false) {
61
        $key = $this->getKeyToSlice($tokenType);
62
        if ($key === false) return new Tokens([]);
63
        if ($inclusive) $key++;
64
        return new Tokens(array_slice($this->tokens, $this->iterator, $key));
65
    }
66
67
    public function skip($count) {
68
        $this->iterator += $count;