createsContact = $createsContact; } public function execute(int $type, int $referenceId, Request $request){ try { $object = new ContactObject($type, $referenceId, $request->input('name'), $request->input('designation'), $request->input('contact'), $request->input('email')); return $this->createsContact->execute($object); } catch (CannotCreateContactException $exception){ throw new InternalServerErrorException("Failed to create contact because {$exception->getMessage()}"); } } }