GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DomFactory::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
4
5
namespace Katten\Purge\Factory;
6
7
8
use Katten\Purge\PurgeHtmlCrawler;
9
use Katten\Purge\Exceptions\UnableToReadInFileException;
10
11
12
class DomFactory extends FileFactory {
13
14
15
    /**
16
     * Build a preloaded Dom object
17
     * 
18
     * @param string $file
19
     *      A local file path or remote url
20
     * 
21
     * @return
22
     *      A Dom object with the HTML parsed
23
     */ 
24
    public static function build($file) {
25
        
26
        $html = parent::buildFromFile($file);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (buildFromFile() instead of build()). Are you sure this is correct? If so, you might want to change this to $this->buildFromFile().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
27
        
28
        $dom = new PurgeHtmlCrawler($html);
29
        
30
        return $dom;
31
    }
32
33
}
34