Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated Response constructors #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/SlackDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,13 @@ public function sendPayload($payload)
return $this->http->post('https://slack.com/api/dialog.open', [], $payload);
}

return JsonResponse::create($payload)->send();
$response = new JsonResponse($payload);

return $response->send();
}

/**
* @param $message
* @param $message
* @param array $additionalParameters
* @param \BotMan\BotMan\Messages\Incoming\IncomingMessage $matchingMessage
* @return array
Expand All @@ -280,7 +282,7 @@ public function replyInThread($message, $additionalParameters, $matchingMessage,
}

/**
* @param $message
* @param $message
* @param array $additionalParameters
* @param \BotMan\BotMan\Messages\Incoming\IncomingMessage $matchingMessage
* @return array
Expand Down Expand Up @@ -428,7 +430,9 @@ public function verifyRequest(Request $request)
{
$payload = Collection::make(json_decode($request->getContent(), true));
if ($payload->get('type') === 'url_verification') {
return Response::create($payload->get('challenge'))->send();
$response = new Response($payload->get('challenge'));

return $response->send();
}
}

Expand Down Expand Up @@ -477,7 +481,9 @@ public function extendConversation()
if (count($errors)) {
$this->bot->touchCurrentConversation();

return Response::create(json_encode(['errors' => $errors]), 200, ['ContentType' => 'application/json'])->send();
$responseObj = new Response(json_encode(['errors' => $errors]), 200, ['ContentType' => 'application/json']);

return $responseObj->send();
} else {
if ($next instanceof \Closure) {
$next = $next->bindTo($this, $this);
Expand Down