| @@ 164-168 (lines=5) @@ | ||
| 161 | * @throws UnsupportedMediaType if the content type is not supported |
|
| 162 | */ |
|
| 163 | private function createTag($data, $contentType = 'application/json') { |
|
| 164 | if (explode(';', $contentType)[0] === 'application/json') { |
|
| 165 | $data = json_decode($data, true); |
|
| 166 | } else { |
|
| 167 | throw new UnsupportedMediaType(); |
|
| 168 | } |
|
| 169 | ||
| 170 | if (!isset($data['name'])) { |
|
| 171 | throw new BadRequest('Missing "name" attribute'); |
|
| @@ 225-229 (lines=5) @@ | ||
| 222 | * @throws UnsupportedMediaType if the content type is not supported |
|
| 223 | */ |
|
| 224 | private function createComment($objectType, $objectId, $data, $contentType = 'application/json') { |
|
| 225 | if (explode(';', $contentType)[0] === 'application/json') { |
|
| 226 | $data = json_decode($data, true); |
|
| 227 | } else { |
|
| 228 | throw new UnsupportedMediaType(); |
|
| 229 | } |
|
| 230 | ||
| 231 | $actorType = $data['actorType']; |
|
| 232 | $actorId = null; |
|