Code Duplication    Length = 5-5 lines in 2 locations

src/Hal/Component/OOP/Extractor/Searcher.php 2 locations

@@ 130-134 (lines=5) @@
127
    }
128
129
    public function getPositionOfPrevious($tokenType, $n, TokenCollection $tokens) {
130
        for($i = $n; $i > 0; $i--) {
131
            if($tokenType == $tokens->get($i)->getType()) {
132
                return $i;
133
            }
134
        }
135
        return null;
136
    }
137
@@ 140-144 (lines=5) @@
137
138
    public function getPositionOfNext($tokenType, $n, TokenCollection $tokens) {
139
        $len = sizeof($tokens);
140
        for($i = $n; $i < $len; $i++) {
141
            if($tokenType == $tokens->get($i)->getType()) {
142
                return $i;
143
            }
144
        }
145
        return null;
146
    }
147