Code Duplication    Length = 5-5 lines in 2 locations

apps/dav/lib/Comments/CommentsPlugin.php 1 location

@@ 221-225 (lines=5) @@
218
	 * @throws UnsupportedMediaType if the content type is not supported
219
	 */
220
	private function createComment($objectType, $objectId, $data, $contentType = 'application/json') {
221
		if (explode(';', $contentType)[0] === 'application/json') {
222
			$data = json_decode($data, true);
223
		} else {
224
			throw new UnsupportedMediaType();
225
		}
226
227
		$actorType = $data['actorType'];
228
		$actorId = null;

apps/dav/lib/SystemTag/SystemTagPlugin.php 1 location

@@ 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');