Browse Source

Addressing comments, array() to []

Signed-off-by: Branko Kokanovic <branko@kokanovic.org>
pull/12766/head
Branko Kokanovic 7 years ago
parent
commit
7cef9b0248
  1. 2
      lib/private/Mail/Mailer.php
  2. 4
      tests/lib/Mail/MailerTest.php

2
lib/private/Mail/Mailer.php

@ -259,7 +259,7 @@ class Mailer implements IMailer {
if (!empty($smtpSecurity)) {
$transport->setEncryption($smtpSecurity);
}
$streamingOptions = $this->config->getSystemValue('mail_smtpstreamoptions', array());
$streamingOptions = $this->config->getSystemValue('mail_smtpstreamoptions', []);
if (is_array($streamingOptions) && !empty($streamingOptions)) {
$transport->setStreamOptions($streamingOptions);
}

4
tests/lib/Mail/MailerTest.php

@ -172,7 +172,7 @@ class MailerTest extends TestCase {
$this->config->method('getSystemValue')
->will($this->returnValueMap([
['mail_smtpmode', 'smtp', 'smtp'],
['mail_smtpstreamoptions', array(), array('foo' => 1)]
['mail_smtpstreamoptions', [], ['foo' => 1]]
]));
$mailer = self::invokePrivate($this->mailer, 'getInstance');
$this->assertEquals(1, count($mailer->getTransport()->getStreamOptions()));
@ -184,7 +184,7 @@ class MailerTest extends TestCase {
$this->config->method('getSystemValue')
->will($this->returnValueMap([
['mail_smtpmode', 'smtp', 'smtp'],
['mail_smtpstreamoptions', array(), 'bar']
['mail_smtpstreamoptions', [], 'bar']
]));
$mailer = self::invokePrivate($this->mailer, 'getInstance');
$this->assertEquals(0, count($mailer->getTransport()->getStreamOptions()));

Loading…
Cancel
Save