Code Duplication    Length = 5-5 lines in 2 locations

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

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