Completed
Pull Request — master (#85)
by thomas
04:06
created

DnsSeedList::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace BitWasp\Bitcoin\Networking\DnsSeeds;
4
5
class DnsSeedList
6
{
7
    /**
8
     * @var array
9
     */
10
    private $seeds = [];
11
12
    /**
13
     * DnsSeedList constructor.
14
     * @param array $seeds
15
     */
16 18
    public function __construct(array $seeds)
17
    {
18 18
        $this->seeds = $seeds;
19 18
    }
20
21
    /**
22
     * @param string $host
23
     * @return $this
24
     */
25 3
    public function addHost($host)
26
    {
27 3
        $this->seeds[] = $host;
28 3
        return $this;
29
    }
30
31
    /**
32
     * @return array
33
     */
34 15
    public function getHosts()
35
    {
36 15
        return $this->seeds;
37
    }
38
}
39