Code Duplication    Length = 11-11 lines in 2 locations

src/PfPageparser.php 2 locations

@@ 183-193 (lines=11) @@
180
        foreach($this->chunks as $id => $chunk){
181
            //
182
            $keep_chunk=true;
183
            if(!empty($pattern_keep)){
184
                $pattern_found=false;
185
                foreach($pattern_keep as $pattern){
186
                    if($is_regex){
187
                        $pattern_found=($pattern_found OR preg_match($pattern,$chunk,$matches));
188
                    } else {
189
                        $pattern_found=($pattern_found OR strstr($chunk,$pattern));
190
                    }
191
                }
192
                $keep_chunk=($keep_chunk AND $pattern_found);
193
            }
194
            if(!empty($pattern_remove)){
195
                $pattern_found=false;
196
                foreach($pattern_remove as $pattern){
@@ 194-204 (lines=11) @@
191
                }
192
                $keep_chunk=($keep_chunk AND $pattern_found);
193
            }
194
            if(!empty($pattern_remove)){
195
                $pattern_found=false;
196
                foreach($pattern_remove as $pattern){
197
                    if($is_regex){
198
                        $pattern_found=($pattern_found OR preg_match($pattern,$chunk,$matches));
199
                    } else {
200
                        $pattern_found=($pattern_found OR strstr($chunk,$pattern));
201
                    }
202
                }
203
                $keep_chunk=($keep_chunk AND !$pattern_found);
204
            }
205
            if(!$keep_chunk){
206
                unset($this->chunks[$id]);
207
            }