'Retrieved Milestone Task Assignee', 'message' => 'You have successfully retrieved a Milestone Task Assignee' ]; } /** @var CanFetchMilestoneTaskAssignee */ private $canFetchMilestoneTaskAssignee; /** @var FetchesMilestoneTaskAssignee */ private $fetchesMilestoneTaskAssignee; /** * FetchMilestoneTaskAssigneeControllerLogic constructor. * @param CanFetchMilestoneTaskAssignee $canFetchMilestoneTaskAssignee * @param FetchesMilestoneTaskAssignee $fetchesMilestoneTaskAssignee */ public function __construct(CanFetchMilestoneTaskAssignee $canFetchMilestoneTaskAssignee, FetchesMilestoneTaskAssignee $fetchesMilestoneTaskAssignee) { $this->canFetchMilestoneTaskAssignee = $canFetchMilestoneTaskAssignee; $this->fetchesMilestoneTaskAssignee = $fetchesMilestoneTaskAssignee; } /** * @param Request $request * @return JsonResponse * @throws ErrorException */ public function logic(Request $request) : JsonResponse { try { $this->canFetchMilestoneTaskAssignee->passes(); $query = $this->fetchesMilestoneTaskAssignee->execute(['id' => $request->route('id')]); return $this->resourceResponse(new MilestoneTaskAssigneeResource($query)); } catch (\Exception $exception){ throw new ErrorException($exception->getMessage(), $exception->getCode()); } } }