SelectorParserDiscovery::find()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PHPHtmlParser\Discovery;
6
7
use PHPHtmlParser\Contracts\Selector\ParserInterface;
8
use PHPHtmlParser\Selector\Parser;
9
10
class SelectorParserDiscovery
11
{
12
    /**
13
     * @var ParserInterface|null
14
     */
15
    private static $parser = null;
16
17 288
    public static function find(): ParserInterface
18
    {
19 288
        if (self::$parser == null) {
20 3
            self::$parser = new Parser();
21
        }
22
23 288
        return self::$parser;
24
    }
25
}
26