Skip to content

Commit

Permalink
Merge pull request #27 from EdwinHoksberg/revert-26-fix/add-guzzle-cl…
Browse files Browse the repository at this point in the history
…ient-options

Revert "added Guzzle options to prevent PHP fatal error"
  • Loading branch information
AndyGaskell authored Jul 30, 2020
2 parents 333a546 + 493fac6 commit 772f1f4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/FcmClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,18 @@ public static function create(string $apiToken, string $projectId): FcmClient
*
* @return array
*/
public function send(Request $request, array $arguments): array
public function send(Request $request): array
{
$default = [
'json' => $request->getBody(),
'http_errors' => false
];

$options = is_array($arguments) && isset($arguments) ? $arguments : $default;
// Build guzzle api client.
$client = $this->getGuzzleClient();

// Generate request url.
$url = $request->getUrl();

// Create and send the request.
$response = $client->post($url, $options);
$response = $client->post($url, [
'json' => $request->getBody()
]);

// Decode the response body from json to a plain php array.
$body = json_decode($response->getBody()->getContents(), true);
Expand Down

0 comments on commit 772f1f4

Please sign in to comment.