Conditions | 5 |
Paths | 6 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
47 | 2 | public function __construct(string $master, array $slaves) |
|
48 | { |
||
49 | 2 | $this->master = $master; |
|
50 | 2 | $this->slaves = $slaves; |
|
51 | $this->data = []; |
||
52 | 2 | ||
53 | 2 | foreach ($slaves as $value) { |
|
54 | 2 | if(empty($value) || !filter_var($value, FILTER_VALIDATE_URL)){ |
|
55 | continue; |
||
56 | } |
||
57 | 2 | ||
58 | 2 | $this->data[] = $value; |
|
59 | } |
||
60 | |||
61 | if (!in_array($master, $this->data)) { |
||
62 | $this->data[] = $master; |
||
63 | 2 | } |
|
64 | |||
65 | 2 | $this->all = CircularArray::fromArray($this->data); |
|
66 | } |
||
119 |