Code Duplication    Length = 11-11 lines in 2 locations

src/PfPageparser.php 2 locations

@@ 173-183 (lines=11) @@
170
        foreach($this->chunks as $id => $chunk){
171
            //
172
            $keep_chunk=true;
173
            if(!empty($pattern_keep)){
174
                $pattern_found=false;
175
                foreach($pattern_keep as $pattern){
176
                    if($is_regex){
177
                        $pattern_found=($pattern_found OR preg_match($pattern,$chunk,$matches));
178
                    } else {
179
                        $pattern_found=($pattern_found OR strstr($chunk,$pattern));
180
                    }
181
                }
182
                $keep_chunk=($keep_chunk AND $pattern_found);
183
            }
184
            if(!empty($pattern_remove)){
185
                $pattern_found=false;
186
                foreach($pattern_remove as $pattern){
@@ 184-194 (lines=11) @@
181
                }
182
                $keep_chunk=($keep_chunk AND $pattern_found);
183
            }
184
            if(!empty($pattern_remove)){
185
                $pattern_found=false;
186
                foreach($pattern_remove as $pattern){
187
                    if($is_regex){
188
                        $pattern_found=($pattern_found OR preg_match($pattern,$chunk,$matches));
189
                    } else {
190
                        $pattern_found=($pattern_found OR strstr($chunk,$pattern));
191
                    }
192
                }
193
                $keep_chunk=($keep_chunk AND !$pattern_found);
194
            }
195
            if(!$keep_chunk){
196
                unset($this->chunks[$id]);
197
            }