Skip to content
Snippets Groups Projects
Commit af9e0e00 authored by Eirik Morland's avatar Eirik Morland
Browse files

Issue #3422111 by eiriksm: PHPCS issues for 3.x

parent b5ea0d07
No related branches found
No related tags found
1 merge request!11Resolve #3422111 "Phpcs issues for"
Pipeline #335314 failed
......@@ -52,6 +52,7 @@ class ClientService implements ClientServiceInterface {
* of php guzzle adapter library.
*
* @return string
* The class name for the class we want to use.
*/
protected function getHttpClientAdapterClass() {
if (class_exists(static::GUZZLE6_ADAPTER)) {
......
......@@ -9,8 +9,8 @@ use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Mail\MailManagerInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\sparkpost\ClientService;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* The form for sending test mails from Sparkpost.
......
......@@ -67,7 +67,7 @@ class SparkpostMail implements MailInterface {
// Prepare headers, defaulting the reply-to to the from address since
// Sparkpost needs the from address to be configured separately.
// Note that only Reply-To and X-* headers are allowed.
$headers = isset($message['headers']) ? $message['headers'] : [];
$headers = $message['headers'] ?? [];
if (isset($message['params']['sparkpost']['header'])) {
$headers = $message['params']['sparkpost']['header'] + $headers;
}
......@@ -87,7 +87,7 @@ class SparkpostMail implements MailInterface {
}
$to = array_merge($to, $cc, $bcc);
$reply_to = isset($headers['Reply-To']) ? $headers['Reply-To'] : NULL;
$reply_to = $headers['Reply-To'] ?? NULL;
$headers = $this->allowedHeaders($headers);
// Prepare attachments.
......@@ -103,7 +103,7 @@ class SparkpostMail implements MailInterface {
// @todo Check what the mime-mail situation in d8 is, and add fallback for
// that here.
$plain_text = empty($message['params']['plaintext']) ? MailFormatHelper::htmlToText($message['body']) : $message['params']['plaintext'];
$overrides = isset($message['params']['sparkpost']['overrides']) ? $message['params']['sparkpost']['overrides'] : [];
$overrides = $message['params']['sparkpost']['overrides'] ?? [];
$sparkpost_message = $overrides + [
'content' => [
'from' => [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment