Skip to content

Commit dba9670

Browse files
committed
removed useless type juggling
1 parent a162d6f commit dba9670

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/Mail/Message.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function getReturnPath(): string
174174
*/
175175
public function setPriority(int $priority)
176176
{
177-
$this->setHeader('X-Priority', (int) $priority);
177+
$this->setHeader('X-Priority', $priority);
178178
return $this;
179179
}
180180

@@ -194,8 +194,6 @@ public function getPriority(): int
194194
*/
195195
public function setHtmlBody(string $html, string $basePath = NULL)
196196
{
197-
$html = (string) $html;
198-
199197
if ($basePath) {
200198
$cids = [];
201199
$matches = Strings::matchAll(
@@ -298,8 +296,6 @@ private function createAttachment(string $file, string $content = NULL, string $
298296
if ($content === FALSE) {
299297
throw new Nette\FileNotFoundException("Unable to read file '$file'.");
300298
}
301-
} else {
302-
$content = (string) $content;
303299
}
304300
$part->setBody($content);
305301
$part->setContentType($contentType ? $contentType : finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $content));

src/Mail/MimePart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function addPart(MimePart $part = NULL): self
194194
*/
195195
public function setBody(string $body)
196196
{
197-
$this->body = (string) $body;
197+
$this->body = $body;
198198
return $this;
199199
}
200200

src/Mail/SendmailMailer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function send(Message $mail): void
4242
str_replace(Message::EOL, PHP_EOL, $parts[0]),
4343
];
4444
if ($this->commandArgs) {
45-
$args[] = (string) $this->commandArgs;
45+
$args[] = $this->commandArgs;
4646
}
4747
$res = Nette\Utils\Callback::invokeSafe('mail', $args, function ($message) use (&$info) {
4848
$info = ": $message";

0 commit comments

Comments
 (0)