Addressing comments, array() to []

Signed-off-by: Branko Kokanovic <branko@kokanovic.org>
This commit is contained in:
Branko Kokanovic 2018-12-17 23:34:48 +01:00
parent 8101059062
commit 7cef9b0248
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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()));