| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 62 | 3 | public static function createFromArray(array $match): self |
|
| 63 | { |
||
| 64 | 3 | Assert::string($match['type']); |
|
| 65 | 3 | Assert::string($match['id']); |
|
| 66 | 3 | Assert::string($match['attributes']['name']); |
|
| 67 | 3 | Assert::string($match['attributes']['patchVersion']); |
|
| 68 | 3 | Assert::string($match['attributes']['shardId']); |
|
| 69 | 3 | Assert::nullOrString($match['attributes']['stats']); |
|
| 70 | 3 | Assert::string($match['attributes']['titleId']); |
|
| 71 | |||
| 72 | 3 | return new self( |
|
| 73 | 3 | $match['type'], |
|
| 74 | 3 | $match['id'], |
|
| 75 | 3 | $match['attributes']['name'], |
|
| 76 | 3 | $match['attributes']['patchVersion'], |
|
| 77 | 3 | $match['attributes']['shardId'], |
|
| 78 | 3 | $match['attributes']['stats'], |
|
| 79 | 3 | $match['attributes']['titleId'] |
|
| 80 | ); |
||
| 81 | } |
||
| 82 | } |
||
| 83 |