Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 18 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
69 | 6 | public static function createFromArray(array $player): self |
|
70 | { |
||
71 | 6 | Assert::string($player['type']); |
|
72 | 6 | Assert::string($player['id']); |
|
73 | 6 | Assert::string($player['attributes']['name']); |
|
74 | 6 | Assert::string($player['attributes']['patchVersion']); |
|
75 | 6 | Assert::string($player['attributes']['shardId']); |
|
76 | 6 | Assert::integer($player['attributes']['stats']['picture']); |
|
77 | 6 | Assert::integer($player['attributes']['stats']['title']); |
|
78 | 6 | Assert::string($player['attributes']['titleId']); |
|
79 | |||
80 | 6 | return new self( |
|
81 | 6 | $player['type'], |
|
82 | 6 | $player['id'], |
|
83 | 6 | $player['attributes']['name'], |
|
84 | 6 | $player['attributes']['patchVersion'], |
|
85 | 6 | $player['attributes']['shardId'], |
|
86 | 6 | $player['attributes']['stats']['picture'], |
|
87 | 6 | $player['attributes']['stats']['title'], |
|
88 | 6 | $player['attributes']['titleId'] |
|
89 | ); |
||
90 | } |
||
91 | } |
||
92 |