Skip to content

Commit 00809c9

Browse files
committed
used PHP 7.1 features
1 parent 0b6ff39 commit 00809c9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Mail/Message.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ protected function buildText($html)
431431
private function getRandomId()
432432
{
433433
return '<' . Nette\Utils\Random::generate() . '@'
434-
. preg_replace('#[^\w.-]+#', '', isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : php_uname('n'))
434+
. preg_replace('#[^\w.-]+#', '', $_SERVER['HTTP_HOST'] ?? php_uname('n'))
435435
. '>';
436436
}
437437

src/Mail/MimePart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function setHeader($name, $value, $append = FALSE)
9696
*/
9797
public function getHeader($name)
9898
{
99-
return isset($this->headers[$name]) ? $this->headers[$name] : NULL;
99+
return $this->headers[$name] ?? NULL;
100100
}
101101

102102

src/Mail/SmtpMailer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public function __construct(array $options = [])
5656
$this->host = ini_get('SMTP');
5757
$this->port = (int) ini_get('smtp_port');
5858
}
59-
$this->username = isset($options['username']) ? $options['username'] : '';
60-
$this->password = isset($options['password']) ? $options['password'] : '';
61-
$this->secure = isset($options['secure']) ? $options['secure'] : '';
59+
$this->username = $options['username'] ?? '';
60+
$this->password = $options['password'] ?? '';
61+
$this->secure = $options['secure'] ?? '';
6262
$this->timeout = isset($options['timeout']) ? (int) $options['timeout'] : 20;
6363
$this->context = isset($options['context']) ? stream_context_create($options['context']) : stream_context_get_default();
6464
if (!$this->port) {

0 commit comments

Comments
 (0)