| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | 1 | public static function fromResponseData(array $data): self |
|
| 44 | { |
||
| 45 | 1 | $errors = self::buildErrors($data); |
|
| 46 | 1 | if ($errors) { |
|
| 47 | 1 | return new self(null, null, null, null, $errors); |
|
| 48 | } |
||
| 49 | |||
| 50 | 1 | $data = $data['data']; |
|
| 51 | |||
| 52 | 1 | return new self( |
|
| 53 | 1 | $data['id'], |
|
| 54 | 1 | $data["access_token"], |
|
| 55 | 1 | $data['fio'], |
|
| 56 | 1 | $data['agent'], |
|
| 57 | 1 | null |
|
| 58 | ); |
||
| 93 | } |