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.

Code Duplication    Length = 27-27 lines in 2 locations

src/Drivers/HtmlDriver.php 1 location

@@ 10-36 (lines=27) @@
7
use Spatie\Snapshots\Driver;
8
use Spatie\Snapshots\Exceptions\CantBeSerialized;
9
10
class HtmlDriver implements Driver
11
{
12
    public function serialize($data): string
13
    {
14
        if (! is_string($data)) {
15
            throw new CantBeSerialized('Only strings can be serialized to html');
16
        }
17
18
        $domDocument = new DOMDocument('1.0');
19
        $domDocument->preserveWhiteSpace = false;
20
        $domDocument->formatOutput = true;
21
22
        @$domDocument->loadHTML($data); // to ignore HTML5 errors
23
24
        return $domDocument->saveHTML();
25
    }
26
27
    public function extension(): string
28
    {
29
        return 'html';
30
    }
31
32
    public function match($expected, $actual)
33
    {
34
        Assert::assertEquals($expected, $this->serialize($actual));
35
    }
36
}
37

src/Drivers/XmlDriver.php 1 location

@@ 10-36 (lines=27) @@
7
use Spatie\Snapshots\Driver;
8
use Spatie\Snapshots\Exceptions\CantBeSerialized;
9
10
class XmlDriver implements Driver
11
{
12
    public function serialize($data): string
13
    {
14
        if (! is_string($data)) {
15
            throw new CantBeSerialized('Only strings can be serialized to xml');
16
        }
17
18
        $domDocument = new DOMDocument('1.0');
19
        $domDocument->preserveWhiteSpace = false;
20
        $domDocument->formatOutput = true;
21
22
        $domDocument->loadXML($data);
23
24
        return $domDocument->saveXML();
25
    }
26
27
    public function extension(): string
28
    {
29
        return 'xml';
30
    }
31
32
    public function match($expected, $actual)
33
    {
34
        Assert::assertXmlStringEqualsXmlString($expected, $actual);
35
    }
36
}
37