Skip to content

Commit

Permalink
Fix type issues under Mailer namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Sep 3, 2019
1 parent 7b57873 commit feeec53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 0 additions & 8 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -787,14 +787,6 @@
<code>$locale</code>
</PossiblyNullArgument>
</file>
<file src="src/Mailer/Message.php">
<PossiblyInvalidArgument occurrences="1">
<code>env('HTTP_HOST')</code>
</PossiblyInvalidArgument>
<PossiblyNullArgument occurrences="1">
<code>$this-&gt;appCharset</code>
</PossiblyNullArgument>
</file>
<file src="src/Network/Socket.php">
<InvalidArgument occurrences="1">
<code>[$this, '_connectionErrorHandler']</code>
Expand Down
6 changes: 5 additions & 1 deletion src/Mailer/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public function __construct(?array $config = null)
if ($this->appCharset !== null) {
$this->charset = $this->appCharset;
}
$this->domain = preg_replace('/\:\d+$/', '', env('HTTP_HOST'));
$this->domain = preg_replace('/\:\d+$/', '', (string)env('HTTP_HOST'));
if (empty($this->domain)) {
$this->domain = php_uname('n');
}
Expand Down Expand Up @@ -1557,6 +1557,10 @@ protected function encodeString(string $text, string $charset): string
return $text;
}

if ($this->appCharset === null) {
return mb_convert_encoding($text, $charset);
}

return mb_convert_encoding($text, $charset, $this->appCharset);
}

Expand Down

0 comments on commit feeec53

Please sign in to comment.