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