DnsSeedList::getHosts()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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