| Conditions | 4 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 104 | public static function fromApi(array $data): self |
||
| 105 | { |
||
| 106 | $featuring = []; |
||
| 107 | |||
| 108 | if (array_key_exists('with', $data)) { |
||
| 109 | $featuring[] = Artist::fromApi($data['with']); |
||
| 110 | } |
||
| 111 | |||
| 112 | return new self( |
||
| 113 | $data['name'], |
||
| 114 | $data['info'] ?? null, |
||
| 115 | isset($data['cover']) ? Artist::fromApi($data['cover']) : null, |
||
| 116 | isset($data['tape']) ? (bool) $data['tape'] : false, |
||
| 117 | $featuring |
||
| 118 | ); |
||
| 119 | } |
||
| 120 | } |
||
| 121 |