PHP Code Sniffer

This commit is contained in:
David Garcia 2016-07-24 12:40:50 +01:00
parent 88a3e96733
commit 09eda3df13
16 changed files with 225 additions and 182 deletions

View File

@ -3,23 +3,26 @@ namespace Mailgun\Connection\Exceptions;
class GenericHTTPError extends \Exception class GenericHTTPError extends \Exception
{ {
protected $httpResponseCode; protected $httpResponseCode;
protected $httpResponseBody; protected $httpResponseBody;
public function __construct($message=null, $response_code=null, $response_body=null, $code=0, \Exception $previous=null) { public function __construct($message=null, $response_code=null, $response_body=null, $code=0, \Exception $previous=null)
parent::__construct($message, $code, $previous); {
parent::__construct($message, $code, $previous);
$this->httpResponseCode = $response_code;
$this->httpResponseBody = $response_body; $this->httpResponseCode = $response_code;
} $this->httpResponseBody = $response_body;
}
public function getHttpResponseCode() {
return $this->httpResponseCode; public function getHttpResponseCode()
} {
return $this->httpResponseCode;
public function getHttpResponseBody() { }
return $this->httpResponseBody;
} public function getHttpResponseBody()
{
return $this->httpResponseBody;
}
} }
?> ?>

View File

@ -1,4 +1,6 @@
<?php <?php
namespace Mailgun\Connection\Exceptions; namespace Mailgun\Connection\Exceptions;
class InvalidCredentials extends \Exception{} class InvalidCredentials extends \Exception
{
}

View File

@ -1,4 +1,6 @@
<?php <?php
namespace Mailgun\Connection\Exceptions; namespace Mailgun\Connection\Exceptions;
class MissingEndpoint extends \Exception{} class MissingEndpoint extends \Exception
{
}

View File

@ -1,4 +1,6 @@
<?php <?php
namespace Mailgun\Connection\Exceptions; namespace Mailgun\Connection\Exceptions;
class MissingRequiredParameters extends \Exception{} class MissingRequiredParameters extends \Exception
{
}

View File

@ -1,4 +1,6 @@
<?php <?php
namespace Mailgun\Connection\Exceptions; namespace Mailgun\Connection\Exceptions;
class NoDomainsConfigured extends \Exception{} class NoDomainsConfigured extends \Exception
{
}

View File

@ -21,6 +21,7 @@ class RestClient
{ {
/** /**
* Your API key * Your API key
*
* @var string * @var string
*/ */
private $apiKey; private $apiKey;
@ -37,20 +38,22 @@ class RestClient
/** /**
* The version of the API to use * The version of the API to use
*
* @var string * @var string
*/ */
protected $apiVersion = 'v2'; protected $apiVersion = 'v2';
/** /**
* If we should use SSL or not * If we should use SSL or not
*
* @var bool * @var bool
*/ */
protected $sslEnabled = true; protected $sslEnabled = true;
/** /**
* @param string $apiKey * @param string $apiKey
* @param string $apiHost * @param string $apiHost
* @param HttpClient $httpClient * @param HttpClient $httpClient
*/ */
public function __construct($apiKey, $apiHost, HttpClient $httpClient = null) public function __construct($apiKey, $apiHost, HttpClient $httpClient = null)
{ {
@ -207,23 +210,23 @@ class RestClient
$httpResponseCode = (int)$responseObj->getStatusCode(); $httpResponseCode = (int)$responseObj->getStatusCode();
switch ($httpResponseCode) { switch ($httpResponseCode) {
case 200: case 200:
$data = (string)$responseObj->getBody(); $data = (string)$responseObj->getBody();
$jsonResponseData = json_decode($data, false); $jsonResponseData = json_decode($data, false);
$result = new \stdClass(); $result = new \stdClass();
// return response data as json if possible, raw if not // return response data as json if possible, raw if not
$result->http_response_body = $data && $jsonResponseData === null ? $data : $jsonResponseData; $result->http_response_body = $data && $jsonResponseData === null ? $data : $jsonResponseData;
$result->http_response_code = $httpResponseCode; $result->http_response_code = $httpResponseCode;
return $result; return $result;
case 400: case 400:
throw new MissingRequiredParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_PARAMETERS . $this->getResponseExceptionMessage($responseObj)); throw new MissingRequiredParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_PARAMETERS . $this->getResponseExceptionMessage($responseObj));
case 401: case 401:
throw new InvalidCredentials(ExceptionMessages::EXCEPTION_INVALID_CREDENTIALS); throw new InvalidCredentials(ExceptionMessages::EXCEPTION_INVALID_CREDENTIALS);
case 404: case 404:
throw new MissingEndpoint(ExceptionMessages::EXCEPTION_MISSING_ENDPOINT . $this->getResponseExceptionMessage($responseObj)); throw new MissingEndpoint(ExceptionMessages::EXCEPTION_MISSING_ENDPOINT . $this->getResponseExceptionMessage($responseObj));
default: default:
throw new GenericHTTPError(ExceptionMessages::EXCEPTION_GENERIC_HTTP_ERROR, $httpResponseCode, $responseObj->getBody()); throw new GenericHTTPError(ExceptionMessages::EXCEPTION_GENERIC_HTTP_ERROR, $httpResponseCode, $responseObj->getBody());
} }
} }

View File

@ -4,7 +4,8 @@
namespace Mailgun\Constants; namespace Mailgun\Constants;
class Api { class Api
{
const API_USER = "api"; const API_USER = "api";
const SDK_VERSION = "1.7"; const SDK_VERSION = "1.7";
const SDK_USER_AGENT = "mailgun-sdk-php"; const SDK_USER_AGENT = "mailgun-sdk-php";

View File

@ -4,7 +4,8 @@
namespace Mailgun\Constants; namespace Mailgun\Constants;
class ExceptionMessages { class ExceptionMessages
{
const EXCEPTION_INVALID_CREDENTIALS = "Your credentials are incorrect."; const EXCEPTION_INVALID_CREDENTIALS = "Your credentials are incorrect.";
const EXCEPTION_GENERIC_HTTP_ERROR = "An HTTP Error has occurred! Check your network connection and try again."; const EXCEPTION_GENERIC_HTTP_ERROR = "An HTTP Error has occurred! Check your network connection and try again.";
const EXCEPTION_MISSING_REQUIRED_PARAMETERS = "The parameters passed to the API were invalid. Check your inputs!"; const EXCEPTION_MISSING_REQUIRED_PARAMETERS = "The parameters passed to the API were invalid. Check your inputs!";

View File

@ -12,7 +12,8 @@ use Mailgun\Messages\Expcetions\InvalidParameterType;
* *
* @link https://github.com/mailgun/mailgun-php/blob/master/src/Mailgun/Lists/README.md * @link https://github.com/mailgun/mailgun-php/blob/master/src/Mailgun/Lists/README.md
*/ */
class OptInHandler{ class OptInHandler
{
/** /**
* @param string $mailingList * @param string $mailingList
@ -20,34 +21,36 @@ class OptInHandler{
* @param string $recipientAddress * @param string $recipientAddress
* @return string * @return string
*/ */
public function generateHash($mailingList, $secretAppId, $recipientAddress){ public function generateHash($mailingList, $secretAppId, $recipientAddress)
$innerPayload = array('r' => $recipientAddress, 'l' => $mailingList); {
$encodedInnerPayload = base64_encode(json_encode($innerPayload)); $innerPayload = array('r' => $recipientAddress, 'l' => $mailingList);
$encodedInnerPayload = base64_encode(json_encode($innerPayload));
$innerHash = hash_hmac("sha1", $encodedInnerPayload, $secretAppId); $innerHash = hash_hmac("sha1", $encodedInnerPayload, $secretAppId);
$outerPayload = array('h' => $innerHash, 'p' => $encodedInnerPayload); $outerPayload = array('h' => $innerHash, 'p' => $encodedInnerPayload);
return urlencode(base64_encode(json_encode($outerPayload))); return urlencode(base64_encode(json_encode($outerPayload)));
} }
/** /**
* @param string $secretAppId * @param string $secretAppId
* @param string $uniqueHash * @param string $uniqueHash
* @return array|bool * @return array|bool
*/ */
public function validateHash($secretAppId, $uniqueHash){ public function validateHash($secretAppId, $uniqueHash)
$decodedOuterPayload = json_decode(base64_decode(urldecode($uniqueHash)), true); {
$decodedOuterPayload = json_decode(base64_decode(urldecode($uniqueHash)), true);
$decodedHash = $decodedOuterPayload['h']; $decodedHash = $decodedOuterPayload['h'];
$innerPayload = $decodedOuterPayload['p']; $innerPayload = $decodedOuterPayload['p'];
$decodedInnerPayload = json_decode(base64_decode($innerPayload), true); $decodedInnerPayload = json_decode(base64_decode($innerPayload), true);
$computedInnerHash = hash_hmac("sha1", $innerPayload, $secretAppId); $computedInnerHash = hash_hmac("sha1", $innerPayload, $secretAppId);
if($computedInnerHash == $decodedHash){ if($computedInnerHash == $decodedHash) {
return array('recipientAddress' => $decodedInnerPayload['r'], 'mailingList' => $decodedInnerPayload['l']); return array('recipientAddress' => $decodedInnerPayload['r'], 'mailingList' => $decodedInnerPayload['l']);
} }
return false; return false;
} }
} }

View File

@ -16,7 +16,8 @@ use Mailgun\Messages\MessageBuilder;
* *
* @link https://github.com/mailgun/mailgun-php/blob/master/README.md * @link https://github.com/mailgun/mailgun-php/blob/master/README.md
*/ */
class Mailgun{ class Mailgun
{
/** /**
* @var RestClient * @var RestClient
@ -30,8 +31,8 @@ class Mailgun{
/** /**
* @param string|null $apiKey * @param string|null $apiKey
* @param HttpClient $httpClient * @param HttpClient $httpClient
* @param string $apiEndpoint * @param string $apiEndpoint
*/ */
public function __construct( public function __construct(
$apiKey = null, $apiKey = null,
@ -47,17 +48,18 @@ class Mailgun{
* MIME string. If sending MIME, the string must be passed in to the 3rd * MIME string. If sending MIME, the string must be passed in to the 3rd
* position of the function call. * position of the function call.
* *
* @param string $workingDomain * @param string $workingDomain
* @param array $postData * @param array $postData
* @param array $postFiles * @param array $postFiles
* @return \stdClass * @return \stdClass
* @throws Exceptions\MissingRequiredMIMEParameters * @throws Exceptions\MissingRequiredMIMEParameters
*/ */
public function sendMessage($workingDomain, $postData, $postFiles = array()){ public function sendMessage($workingDomain, $postData, $postFiles = array())
if(is_array($postFiles)){ {
if(is_array($postFiles)) {
return $this->post("$workingDomain/messages", $postData, $postFiles); return $this->post("$workingDomain/messages", $postData, $postFiles);
} }
else if(is_string($postFiles)){ else if(is_string($postFiles)) {
$tempFile = tempnam(sys_get_temp_dir(), "MG_TMP_MIME"); $tempFile = tempnam(sys_get_temp_dir(), "MG_TMP_MIME");
$fileHandle = fopen($tempFile, "w"); $fileHandle = fopen($tempFile, "w");
@ -83,10 +85,11 @@ class Mailgun{
* If this function returns FALSE, you must not process the request. * If this function returns FALSE, you must not process the request.
* You should reject the request with status code 403 Forbidden. * You should reject the request with status code 403 Forbidden.
* *
* @param array|null $postData * @param array|null $postData
* @return bool * @return bool
*/ */
public function verifyWebhookSignature($postData = NULL) { public function verifyWebhookSignature($postData = null)
{
if($postData === null) { if($postData === null) {
$postData = $_POST; $postData = $_POST;
} }
@ -106,20 +109,22 @@ class Mailgun{
/** /**
* @param string $endpointUrl * @param string $endpointUrl
* @param array $postData * @param array $postData
* @param array $files * @param array $files
* @return \stdClass * @return \stdClass
*/ */
public function post($endpointUrl, $postData = array(), $files = array()){ public function post($endpointUrl, $postData = array(), $files = array())
{
return $this->restClient->post($endpointUrl, $postData, $files); return $this->restClient->post($endpointUrl, $postData, $files);
} }
/** /**
* @param string $endpointUrl * @param string $endpointUrl
* @param array $queryString * @param array $queryString
* @return \stdClass * @return \stdClass
*/ */
public function get($endpointUrl, $queryString = array()){ public function get($endpointUrl, $queryString = array())
{
return $this->restClient->get($endpointUrl, $queryString); return $this->restClient->get($endpointUrl, $queryString);
} }
@ -127,16 +132,18 @@ class Mailgun{
* @param string $endpointUrl * @param string $endpointUrl
* @return \stdClass * @return \stdClass
*/ */
public function delete($endpointUrl){ public function delete($endpointUrl)
{
return $this->restClient->delete($endpointUrl); return $this->restClient->delete($endpointUrl);
} }
/** /**
* @param string $endpointUrl * @param string $endpointUrl
* @param array $putData * @param array $putData
* @return \stdClass * @return \stdClass
*/ */
public function put($endpointUrl, $putData){ public function put($endpointUrl, $putData)
{
return $this->restClient->put($endpointUrl, $putData); return $this->restClient->put($endpointUrl, $putData);
} }
@ -167,23 +174,26 @@ class Mailgun{
/** /**
* @return MessageBuilder * @return MessageBuilder
*/ */
public function MessageBuilder(){ public function MessageBuilder()
{
return new MessageBuilder(); return new MessageBuilder();
} }
/** /**
* @return OptInHandler * @return OptInHandler
*/ */
public function OptInHandler(){ public function OptInHandler()
{
return new OptInHandler(); return new OptInHandler();
} }
/** /**
* @param string $workingDomain * @param string $workingDomain
* @param bool $autoSend * @param bool $autoSend
* @return BatchMessage * @return BatchMessage
*/ */
public function BatchMessage($workingDomain, $autoSend = true){ public function BatchMessage($workingDomain, $autoSend = true)
{
return new BatchMessage($this->restClient, $workingDomain, $autoSend); return new BatchMessage($this->restClient, $workingDomain, $autoSend);
} }
} }

View File

@ -13,134 +13,140 @@ use Mailgun\Messages\Exceptions\MissingRequiredMIMEParameters;
* *
* @link https://github.com/mailgun/mailgun-php/blob/master/src/Mailgun/Messages/README.md * @link https://github.com/mailgun/mailgun-php/blob/master/src/Mailgun/Messages/README.md
*/ */
class BatchMessage extends MessageBuilder{ class BatchMessage extends MessageBuilder
{
/** /**
* @var array * @var array
*/ */
private $batchRecipientAttributes; private $batchRecipientAttributes;
/** /**
* @var boolean * @var boolean
*/ */
private $autoSend; private $autoSend;
/** /**
* @var \Mailgun\Connection\RestClient * @var \Mailgun\Connection\RestClient
*/ */
private $restClient; private $restClient;
/** /**
* @var string * @var string
*/ */
private $workingDomain; private $workingDomain;
/** /**
* @var array * @var array
*/ */
private $messageIds = array(); private $messageIds = array();
/** /**
* @var string * @var string
*/ */
private $endpointUrl; private $endpointUrl;
/** /**
* @param \Mailgun\Connection\RestClient $restClient * @param \Mailgun\Connection\RestClient $restClient
* @param string $workingDomain * @param string $workingDomain
* @param boolean $autoSend * @param boolean $autoSend
*/ */
public function __construct($restClient, $workingDomain, $autoSend){ public function __construct($restClient, $workingDomain, $autoSend)
$this->batchRecipientAttributes = array(); {
$this->autoSend = $autoSend; $this->batchRecipientAttributes = array();
$this->restClient = $restClient; $this->autoSend = $autoSend;
$this->workingDomain = $workingDomain; $this->restClient = $restClient;
$this->endpointUrl = $workingDomain . "/messages"; $this->workingDomain = $workingDomain;
} $this->endpointUrl = $workingDomain . "/messages";
}
/** /**
* @param string $headerName * @param string $headerName
* @param string $address * @param string $address
* @param array $variables * @param array $variables
* @throws MissingRequiredMIMEParameters * @throws MissingRequiredMIMEParameters
* @throws TooManyParameters * @throws TooManyParameters
*/ */
protected function addRecipient($headerName, $address, $variables){ protected function addRecipient($headerName, $address, $variables)
if(array_key_exists($headerName, $this->counters['recipients'])){ {
if($this->counters['recipients'][$headerName] == Api::RECIPIENT_COUNT_LIMIT){ if(array_key_exists($headerName, $this->counters['recipients'])) {
if($this->autoSend == false){ if($this->counters['recipients'][$headerName] == Api::RECIPIENT_COUNT_LIMIT) {
throw new TooManyParameters(ExceptionMessages::TOO_MANY_RECIPIENTS); if($this->autoSend == false) {
} throw new TooManyParameters(ExceptionMessages::TOO_MANY_RECIPIENTS);
$this->sendMessage(); }
} $this->sendMessage();
} }
}
$compiledAddress = $this->parseAddress($address, $variables); $compiledAddress = $this->parseAddress($address, $variables);
if(isset($this->message[$headerName])){ if(isset($this->message[$headerName])) {
array_push($this->message[$headerName], $compiledAddress); array_push($this->message[$headerName], $compiledAddress);
} }
elseif($headerName == "h:reply-to"){ elseif($headerName == "h:reply-to") {
$this->message[$headerName] = $compiledAddress; $this->message[$headerName] = $compiledAddress;
} }
else{ else{
$this->message[$headerName] = array($compiledAddress); $this->message[$headerName] = array($compiledAddress);
} }
if(array_key_exists($headerName, $this->counters['recipients'])){ if(array_key_exists($headerName, $this->counters['recipients'])) {
$this->counters['recipients'][$headerName] += 1; $this->counters['recipients'][$headerName] += 1;
if(!array_key_exists("id", $variables)){ if(!array_key_exists("id", $variables)) {
$variables['id'] = $this->counters['recipients'][$headerName]; $variables['id'] = $this->counters['recipients'][$headerName];
} }
} }
$this->batchRecipientAttributes["$address"] = $variables; $this->batchRecipientAttributes["$address"] = $variables;
} }
/** /**
* @param array $message * @param array $message
* @param array $files * @param array $files
* @throws MissingRequiredMIMEParameters * @throws MissingRequiredMIMEParameters
*/ */
public function sendMessage($message = array(), $files = array()){ public function sendMessage($message = array(), $files = array())
if(count($message) < 1){ {
$message = $this->message; if(count($message) < 1) {
$files = $this->files; $message = $this->message;
} $files = $this->files;
if(!array_key_exists("from", $message)){ }
throw new MissingRequiredMIMEParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS); if(!array_key_exists("from", $message)) {
} throw new MissingRequiredMIMEParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS);
elseif(!array_key_exists("to", $message)){ }
throw new MissingRequiredMIMEParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS); elseif(!array_key_exists("to", $message)) {
} throw new MissingRequiredMIMEParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS);
elseif(!array_key_exists("subject", $message)){ }
throw new MissingRequiredMIMEParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS); elseif(!array_key_exists("subject", $message)) {
} throw new MissingRequiredMIMEParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS);
elseif((!array_key_exists("text", $message) && !array_key_exists("html", $message))){ }
throw new MissingRequiredMIMEParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS); elseif((!array_key_exists("text", $message) && !array_key_exists("html", $message))) {
} throw new MissingRequiredMIMEParameters(ExceptionMessages::EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS);
else{ }
$message["recipient-variables"] = json_encode($this->batchRecipientAttributes); else{
$response = $this->restClient->post($this->endpointUrl, $message, $files); $message["recipient-variables"] = json_encode($this->batchRecipientAttributes);
$this->batchRecipientAttributes = array(); $response = $this->restClient->post($this->endpointUrl, $message, $files);
$this->counters['recipients']['to'] = 0; $this->batchRecipientAttributes = array();
$this->counters['recipients']['cc'] = 0; $this->counters['recipients']['to'] = 0;
$this->counters['recipients']['bcc'] = 0; $this->counters['recipients']['cc'] = 0;
unset($this->message["to"]); $this->counters['recipients']['bcc'] = 0;
array_push($this->messageIds, $response->http_response_body->id); unset($this->message["to"]);
} array_push($this->messageIds, $response->http_response_body->id);
} }
}
/** /**
* @throws MissingRequiredMIMEParameters * @throws MissingRequiredMIMEParameters
*/ */
public function finalize(){ public function finalize()
$this->sendMessage(); {
} $this->sendMessage();
}
/** /**
* @return string[] * @return string[]
*/ */
public function getMessageIds(){ public function getMessageIds()
return $this->messageIds; {
} return $this->messageIds;
}
} }

View File

@ -1,4 +1,6 @@
<?php <?php
namespace Mailgun\Messages\Exceptions; namespace Mailgun\Messages\Exceptions;
class InvalidParameter extends \Exception{} class InvalidParameter extends \Exception
{
}

View File

@ -1,4 +1,6 @@
<?php <?php
namespace Mailgun\Messages\Exceptions; namespace Mailgun\Messages\Exceptions;
class InvalidParameterType extends \Exception{} class InvalidParameterType extends \Exception
{
}

View File

@ -1,4 +1,6 @@
<?php <?php
namespace Mailgun\Messages\Exceptions; namespace Mailgun\Messages\Exceptions;
class MissingRequiredMIMEParameters extends \Exception{} class MissingRequiredMIMEParameters extends \Exception
{
}

View File

@ -1,4 +1,6 @@
<?php <?php
namespace Mailgun\Messages\Exceptions; namespace Mailgun\Messages\Exceptions;
class TooManyParameters extends \Exception{} class TooManyParameters extends \Exception
{
}

View File

@ -50,9 +50,9 @@ class MessageBuilder
); );
/** /**
* @param array $params * @param array $params
* @param string $key * @param string $key
* @param mixed $default * @param mixed $default
* @return mixed * @return mixed
*/ */
protected function safeGet($params, $key, $default) protected function safeGet($params, $key, $default)
@ -82,7 +82,7 @@ class MessageBuilder
/** /**
* @param string $address * @param string $address
* @param array $variables * @param array $variables
* @return string * @return string
*/ */
protected function parseAddress($address, $variables) protected function parseAddress($address, $variables)
@ -101,7 +101,7 @@ class MessageBuilder
/** /**
* @param string $headerName * @param string $headerName
* @param string $address * @param string $address
* @param array $variables * @param array $variables
*/ */
protected function addRecipient($headerName, $address, $variables) protected function addRecipient($headerName, $address, $variables)
{ {
@ -120,7 +120,7 @@ class MessageBuilder
} }
/** /**
* @param string $address * @param string $address
* @param array|null $variables * @param array|null $variables
* @return mixed * @return mixed
* @throws TooManyParameters * @throws TooManyParameters
@ -136,7 +136,7 @@ class MessageBuilder
} }
/** /**
* @param string $address * @param string $address
* @param array|null $variables * @param array|null $variables
* @return mixed * @return mixed
* @throws TooManyParameters * @throws TooManyParameters
@ -152,7 +152,7 @@ class MessageBuilder
} }
/** /**
* @param string $address * @param string $address
* @param array|null $variables * @param array|null $variables
* @return mixed * @return mixed
* @throws TooManyParameters * @throws TooManyParameters
@ -168,7 +168,7 @@ class MessageBuilder
} }
/** /**
* @param string $address * @param string $address
* @param array|null $variables * @param array|null $variables
* @return mixed * @return mixed
*/ */
@ -180,7 +180,7 @@ class MessageBuilder
} }
/** /**
* @param string $address * @param string $address
* @param array|null $variables * @param array|null $variables
* @return mixed * @return mixed
*/ */
@ -207,7 +207,7 @@ class MessageBuilder
/** /**
* @param string $headerName * @param string $headerName
* @param mixed $headerData * @param mixed $headerData
* @return mixed * @return mixed
*/ */
public function addCustomHeader($headerName, $headerData) public function addCustomHeader($headerName, $headerData)
@ -249,7 +249,7 @@ class MessageBuilder
} }
/** /**
* @param string $attachmentPath * @param string $attachmentPath
* @param string|null $attachmentName * @param string|null $attachmentName
* @return bool * @return bool
*/ */
@ -274,7 +274,7 @@ class MessageBuilder
} }
/** /**
* @param string $inlineImagePath * @param string $inlineImagePath
* @param string|null $inlineImageName * @param string|null $inlineImageName
* *
* @return bool|true * @return bool|true
@ -412,7 +412,7 @@ class MessageBuilder
} }
/** /**
* @param string $timeDate * @param string $timeDate
* @param string|null $timeZone * @param string|null $timeZone
* @return string * @return string
*/ */
@ -433,7 +433,7 @@ class MessageBuilder
/** /**
* @param string $customName * @param string $customName
* @param mixed $data * @param mixed $data
*/ */
public function addCustomData($customName, $data) public function addCustomData($customName, $data)
{ {
@ -442,7 +442,7 @@ class MessageBuilder
/** /**
* @param string $parameterName * @param string $parameterName
* @param mixed $data * @param mixed $data
* @return mixed * @return mixed
*/ */
public function addCustomParameter($parameterName, $data) public function addCustomParameter($parameterName, $data)