Code Duplication    Length = 10-10 lines in 2 locations

src/Parser/Sheet.php 1 location

@@ 120-129 (lines=10) @@
117
		return ($a->depth < $b->depth) ? -1 : 1;
118
	}
119
120
	private function stripComments($str, $open, $close) {
121
		$pos = 0;
122
		while (($pos = strpos($str, $open, $pos)) !== false) {
123
			$end = strpos($str, $close, $pos);
124
			if ($end === false) break;
125
			$str = substr_replace($str, '', $pos, $end-$pos+strlen($close));
126
		}
127
128
		return $str;
129
	}
130
131
	private function getProperties($tokens) {
132
        $rules = $tokens->splitOnToken(Tokenizer::SEMI_COLON);

src/TSSValidator.php 1 location

@@ 53-62 (lines=10) @@
50
		return $tokenizer->getTokens();
51
    }
52
53
    private function stripComments($str, $open, $close) {
54
		$pos = 0;
55
		while (($pos = strpos($str, $open, $pos)) !== false) {
56
			$end = strpos($str, $close, $pos);
57
			if ($end === false) break;
58
			$str = substr_replace($str, '', $pos, $end-$pos+strlen($close));
59
		}
60
61
		return $str;
62
	}
63
}
64