Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
55 | 11 | public static function createFromArray(array $player): self |
|
56 | { |
||
57 | 11 | Assert::string($player['type']); |
|
58 | 11 | Assert::string($player['id']); |
|
59 | 11 | Assert::string($player['attributes']['name']); |
|
60 | 11 | Assert::string($player['attributes']['patchVersion']); |
|
61 | 11 | Assert::string($player['attributes']['shardId']); |
|
62 | 11 | Assert::string($player['attributes']['titleId']); |
|
63 | |||
64 | 11 | return new self( |
|
65 | 11 | $player['type'], |
|
66 | 11 | $player['id'], |
|
67 | 11 | $player['attributes']['name'], |
|
68 | 11 | $player['attributes']['patchVersion'], |
|
69 | 11 | $player['attributes']['shardId'], |
|
70 | 11 | $player['attributes']['titleId'] |
|
71 | ); |
||
72 | } |
||
73 | } |
||
74 |