| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 49 | 1 | public static function fromResponseData(array $data): self |
|
| 50 | { |
||
| 51 | 1 | $errors = self::buildErrors($data); |
|
| 52 | 1 | if ($errors) { |
|
| 53 | 1 | return new self(null, null, null, null, null, $errors); |
|
| 54 | } |
||
| 55 | |||
| 56 | 1 | return new self( |
|
| 57 | 1 | $data['id'], |
|
| 58 | 1 | $data["city_id"], |
|
| 59 | 1 | $data['city_name'], |
|
| 60 | 1 | $data['city_timezone'], |
|
| 61 | 1 | $data['region'], |
|
| 62 | 1 | null |
|
| 63 | ); |
||
| 107 | } |