id === null) { throw new BadRequestException('id is required'); } if ($request->description === null) { throw new BadRequestException('description is required'); } $element = $this->elementRepository->find($request->id); if ($element === null) { throw new NotFoundException('Element not found'); } $element->setDescription($request->description); return $this->elementRepository->update($element); } }