Factory::createTldExtractor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace HumanDirect\Socially;
4
5
use LayerShifter\TLDExtract\Extract;
6
use LayerShifter\TLDExtract\Result as TldResult;
7
use LayerShifter\TLDExtract\ResultInterface as TldResultInterface;
8
9
/**
10
 * Class Factory.
11
 */
12
class Factory
13
{
14
    /**
15
     * @return Parser
16
     */
17
    public static function createParser(): Parser
18
    {
19
        return new Parser();
20
    }
21
22
    /**
23
     * @throws \LayerShifter\TLDExtract\Exceptions\RuntimeException
24
     *
25
     * @return Extract
26
     */
27
    public static function createTldExtractor(): Extract
28
    {
29
        return new Extract();
30
    }
31
32
    /**
33
     * @param null|string $subdomain
34
     * @param null|string $hostname
35
     * @param null|string $suffix
36
     *
37
     * @return TldResultInterface
38
     */
39
    public static function createTldResult(?string $subdomain, ?string $hostname, ?string $suffix): TldResultInterface
40
    {
41
        return new TldResult($subdomain, $hostname, $suffix);
42
    }
43
}
44