Add space between if and ‘(‘
[MAILPOET-1791]
This commit is contained in:
@ -10,7 +10,7 @@ class AmazonSESMapper {
|
||||
|
||||
function getErrorFromException(\Exception $e, $subscriber) {
|
||||
$level = MailerError::LEVEL_HARD;
|
||||
if($e instanceof \Swift_RfcComplianceException) {
|
||||
if ($e instanceof \Swift_RfcComplianceException) {
|
||||
$level = MailerError::LEVEL_SOFT;
|
||||
}
|
||||
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||
@ -27,7 +27,7 @@ class AmazonSESMapper {
|
||||
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_AMAZONSES);
|
||||
|
||||
$level = MailerError::LEVEL_HARD;
|
||||
if($response && $response->Error->Code->__toString() === 'MessageRejected') {
|
||||
if ($response && $response->Error->Code->__toString() === 'MessageRejected') {
|
||||
$level = MailerError::LEVEL_SOFT;
|
||||
}
|
||||
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||
|
@ -7,7 +7,7 @@ use MailPoet\Services\Bridge\API;
|
||||
use InvalidArgumentException;
|
||||
use MailPoet\Util\Helpers;
|
||||
|
||||
if(!defined('ABSPATH')) exit;
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
class MailPoetMapper {
|
||||
use ConnectionErrorMapperTrait;
|
||||
@ -35,7 +35,7 @@ class MailPoetMapper {
|
||||
case API::RESPONSE_CODE_PAYLOAD_ERROR:
|
||||
$result_parsed = json_decode($result['message'], true);
|
||||
$message = __('Error while sending.', 'mailpoet');
|
||||
if(!is_array($result_parsed)) {
|
||||
if (!is_array($result_parsed)) {
|
||||
$message .= ' ' . $result['message'];
|
||||
break;
|
||||
}
|
||||
@ -68,11 +68,11 @@ class MailPoetMapper {
|
||||
private function getSubscribersErrors($result_parsed, $subscribers) {
|
||||
$errors = [];
|
||||
foreach ($result_parsed as $result_error) {
|
||||
if(!is_array($result_error) || !isset($result_error['index']) || !isset($subscribers[$result_error['index']])) {
|
||||
if (!is_array($result_error) || !isset($result_error['index']) || !isset($subscribers[$result_error['index']])) {
|
||||
throw new InvalidArgumentException( __('Invalid MSS response format.', 'mailpoet'));
|
||||
}
|
||||
$subscriber_errors = [];
|
||||
if(isset($result_error['errors']) && is_array($result_error['errors'])) {
|
||||
if (isset($result_error['errors']) && is_array($result_error['errors'])) {
|
||||
array_walk_recursive($result_error['errors'], function($item) use (&$subscriber_errors) {
|
||||
$subscriber_errors[] = $item;
|
||||
});
|
||||
|
@ -10,7 +10,7 @@ class PHPMailMapper {
|
||||
|
||||
function getErrorFromException(\Exception $e, $subscriber) {
|
||||
$level = MailerError::LEVEL_HARD;
|
||||
if(strpos($e->getMessage(), 'Invalid address') === 0) {
|
||||
if (strpos($e->getMessage(), 'Invalid address') === 0) {
|
||||
$level = MailerError::LEVEL_SOFT;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class SMTPMapper {
|
||||
$message = explode(PHP_EOL, $e->getMessage());
|
||||
|
||||
$level = MailerError::LEVEL_HARD;
|
||||
if($e instanceof \Swift_RfcComplianceException) {
|
||||
if ($e instanceof \Swift_RfcComplianceException) {
|
||||
$level = MailerError::LEVEL_SOFT;
|
||||
}
|
||||
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||
@ -27,7 +27,7 @@ class SMTPMapper {
|
||||
function getErrorFromLog($log, $subscriber) {
|
||||
// extract error message from log
|
||||
preg_match('/!! (.*?)>>/ism', $log, $message);
|
||||
if(!empty($message[1])) {
|
||||
if (!empty($message[1])) {
|
||||
$message = $message[1];
|
||||
// remove line breaks from the message due to how logger's dump() method works
|
||||
$message = preg_replace('/\r|\n/', '', $message);
|
||||
|
@ -14,7 +14,7 @@ class SendGridMapper {
|
||||
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID);
|
||||
|
||||
$level = MailerError::LEVEL_HARD;
|
||||
if(strpos($response, 'Invalid email address') === 0) {
|
||||
if (strpos($response, 'Invalid email address') === 0) {
|
||||
$level = MailerError::LEVEL_SOFT;
|
||||
}
|
||||
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||
|
Reference in New Issue
Block a user