id === null) { throw new BadRequestException('setId is required'); } if ( $request->description === null || trim($request->description) === '' ) { throw new BadRequestException('description is required'); } $set = $this->setRepository->find($request->id); if ($set === null) { throw new NotFoundException('Set not found'); } $set->setDescription($request->description); return $this->setRepository->update($set); } }