Code Duplication    Length = 11-11 lines in 2 locations

src/PfPageparser.php 2 locations

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