Skip to content
This repository has been archived by the owner on Mar 22, 2020. It is now read-only.

Apply fixes from StyleCI #1

Merged
merged 1 commit into from
Aug 5, 2018
Merged
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: 8 additions & 8 deletions src/LaravelMJML.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use GuzzleHttp\Client as GuzzleClient;

class LaravelMJML {

class LaravelMJML
{
private $secretKey;
protected $appId;
public $publicKey;
Expand Down Expand Up @@ -73,13 +73,13 @@ public function renderRequest(string $mjml)
'auth' => [$this->appId, $this->secretKey],
'headers' => [
'Content-Type' => 'application/x-www-form-urlencoded',
'Accepts' => 'application/json'
'Accepts' => 'application/json',
],
\GuzzleHttp\RequestOptions::JSON => [
'mjml' => $mjml,
],
]);
} catch(\GuzzleHttp\Exception\ClientException $e) {
} catch (\GuzzleHttp\Exception\ClientException $e) {
return json_decode($e->getResponse()->getBody()->getContents());
}

Expand All @@ -95,9 +95,9 @@ public function renderRequest(string $mjml)
public function render(string $mjml)
{
$request = $this->renderRequest($mjml);
if(property_exists($request, 'status_code') && $request->status_code != 200) {
return null;

if (property_exists($request, 'status_code') && $request->status_code != 200) {
return;
}

return $request->html;
Expand All @@ -116,4 +116,4 @@ public function renderWithMustache(string $mjml, array $parameters = [])

return $this->mustache->render($html, $parameters);
}
}
}