| Conditions | 4 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 84 | public static function fromApi(array $data): self |
||
| 85 | { |
||
| 86 | $featuring = []; |
||
| 87 | |||
| 88 | if (\array_key_exists('with', $data)) { |
||
| 89 | $featuring[] = Artist::fromApi($data['with']); |
||
| 90 | } |
||
| 91 | |||
| 92 | return new self( |
||
| 93 | $data['name'], |
||
| 94 | $data['info'] ?? null, |
||
| 95 | isset($data['cover']) ? Artist::fromApi($data['cover']) : null, |
||
| 96 | isset($data['tape']) ? (bool) $data['tape'] : false, |
||
| 97 | $featuring |
||
| 98 | ); |
||
| 99 | } |
||
| 100 | } |
||
| 101 |