Code Duplication    Length = 7-7 lines in 2 locations

src/PfPageparser.php 2 locations

@@ 178-184 (lines=7) @@
175
    {
176
        $matches=false;
177
178
        if(empty($this->chunks)){
179
            if($this->content){
180
                $this->chunks=[$this->content];
181
            } else {
182
                return $this;
183
            }
184
        }
185
        foreach($this->chunks as $id => $chunk){
186
            //
187
            $keep_chunk=true;
@@ 225-231 (lines=7) @@
222
     */
223
    public function parse_fom_chunks(string $pattern,bool $only_one=false, bool $restart=false): PfPageparser
224
    {
225
        if(empty($this->chunks)){
226
            if($this->content){
227
                $this->chunks=[$this->content];
228
            } else {
229
                return $this;
230
            }
231
        }
232
        if($restart or empty($this->parsed)){
233
            $items=&$this->chunks;
234
	$this->parsed=[];