Members::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace PtrTn\Battlerite\Dto\Teams;
4
5
use PtrTn\Battlerite\Assert\Assert;
6
7
class Members
8
{
9
    /**
10
     * @var string]
11
     */
12
    public $members;
13
14 6
    private function __construct(
15
        array $members
16
    ) {
17 6
        $this->members = $members;
18 6
    }
19
20 6
    public static function createFromArray(array $members): self
21
    {
22 6
        $members = array_map('strval', $members);
23 6
        Assert::allString($members);
24
25 6
        return new self($members);
26
    }
27
}
28