| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 118 | 8 | public static function fromArray(array $data) |
|
| 119 | { |
||
| 120 | 8 | if (! isset($data['meta']) || ! isset($data['asset'])) { |
|
| 121 | 3 | throw new \InvalidArgumentException("Need both 'meta' and 'asset'"); |
|
| 122 | } |
||
| 123 | |||
| 124 | 5 | $meta = AssetMeta::fromArray($data['meta']); |
|
| 125 | 5 | $data = $data['asset']; |
|
| 126 | 5 | $data['meta'] = $meta; |
|
| 127 | |||
| 128 | 5 | return self::fromArrayTrait($data); |
|
| 129 | } |
||
| 131 |