Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
43 | 1 | public static function createFromArray($status): self |
|
44 | { |
||
45 | 1 | Assert::string($status['type']); |
|
46 | 1 | Assert::string($status['id']); |
|
47 | 1 | Assert::string($status['attributes']['releasedAt']); |
|
48 | 1 | Assert::string($status['attributes']['version']); |
|
49 | |||
50 | 1 | return new self( |
|
51 | 1 | $status['type'], |
|
52 | 1 | $status['id'], |
|
53 | 1 | DateTime::createFromFormat(DateTime::ISO8601, $status['attributes']['releasedAt']), |
|
|
|||
54 | 1 | $status['attributes']['version'] |
|
55 | ); |
||
56 | } |
||
57 | } |
||
58 |