UpdateDnsRecordFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 34
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A __construct() 0 7 1
1
<?php
2
declare(strict_types = 1);
3
/**
4
 *
5
 * Copyright (C) 2018  Ross Mitchell
6
 *
7
 * This file is part of RossMitchell/UpdateCloudFlare.
8
 *
9
 * RossMitchell/UpdateCloudFlare is free software: you can redistribute
10
 * it and/or modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation, either version 3 of the
12
 * License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
 */
22
23
namespace RossMitchell\UpdateCloudFlare\Factories\Requests;
24
25
use RossMitchell\UpdateCloudFlare\Data\SubDomainInfo;
26
use RossMitchell\UpdateCloudFlare\Interfaces\ConfigInterface;
27
use RossMitchell\UpdateCloudFlare\Interfaces\HeadersInterface;
28
use RossMitchell\UpdateCloudFlare\Requests\UpdateDnsRecords;
29
30
/**
31
 * Class UpdateDnsRecordFactory
32
 * @package RossMitchell\UpdateCloudFlare\Factories\Requests
33
 */
34
class UpdateDnsRecordFactory
35
{
36
    /**
37
     * @var ConfigInterface
38
     */
39
    private $config;
40
    /**
41
     * @var HeadersInterface
42
     */
43
    private $headers;
44
45
    /**
46
     * UpdateDnsRecordFactory constructor.
47
     *
48
     * @param ConfigInterface  $config
49
     * @param HeadersInterface $headers
50
     */
51 9
    public function __construct(
52
        ConfigInterface $config,
53
        HeadersInterface $headers
54
    ) {
55
56 9
        $this->config  = $config;
57 9
        $this->headers = $headers;
58 9
    }
59
60
    /**
61
     * @param SubDomainInfo $subDomainInfo
62
     *
63
     * @return UpdateDnsRecords
64
     */
65 9
    public function create(SubDomainInfo $subDomainInfo): UpdateDnsRecords
66
    {
67 9
        return new UpdateDnsRecords($this->config, $this->headers, $subDomainInfo);
68
    }
69
}
70