| @@ 61-67 (lines=7) @@ | ||
| 58 | * |
|
| 59 | * @throws DataException |
|
| 60 | */ |
|
| 61 | protected static function assertItHasTypeMember(array $data, ErrorBag $errorBag) |
|
| 62 | { |
|
| 63 | if (empty($data[JsonApiTransformer::TYPE_KEY]) || !is_string($data[JsonApiTransformer::TYPE_KEY])) { |
|
| 64 | $errorBag->offsetSet(null, new MissingTypeError()); |
|
| 65 | throw new DataException(); |
|
| 66 | } |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * @param array $data |
|
| @@ 97-103 (lines=7) @@ | ||
| 94 | * |
|
| 95 | * @throws DataException |
|
| 96 | */ |
|
| 97 | protected static function assertItHasAttributeMember($data, ErrorBag $errorBag) |
|
| 98 | { |
|
| 99 | if (empty($data[JsonApiTransformer::ATTRIBUTES_KEY]) || !is_array($data[JsonApiTransformer::ATTRIBUTES_KEY])) { |
|
| 100 | $errorBag->offsetSet(null, new MissingAttributesError()); |
|
| 101 | throw new DataException(); |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * @param array $data |
|