Skip to content

Commit e6e831b

Browse files
committed
Suppress PHPStan error to allow PHP to throw TypeError
1 parent dbccc8a commit e6e831b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Message.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ protected function renderAttachments() : string
335335
}
336336
$filename = \pathinfo($attachment, \PATHINFO_BASENAME);
337337
$filename = \htmlspecialchars($filename, \ENT_QUOTES | \ENT_HTML5);
338-
$contents = (string) \file_get_contents($attachment);
339-
$contents = \base64_encode($contents);
338+
$contents = \file_get_contents($attachment);
339+
$contents = \base64_encode($contents); // @phpstan-ignore-line
340340
$part .= '--mixed-' . $this->getBoundary() . $crlf;
341341
$part .= 'Content-Type: ' . $this->getContentType($attachment)
342342
. '; name="' . $filename . '"' . $crlf;
@@ -360,8 +360,8 @@ protected function renderInlineAttachments() : string
360360
if ( ! \is_file($filename)) {
361361
throw new LogicException('Inline attachment file not found: ' . $filename);
362362
}
363-
$contents = (string) \file_get_contents($filename);
364-
$contents = \base64_encode($contents);
363+
$contents = \file_get_contents($filename);
364+
$contents = \base64_encode($contents); // @phpstan-ignore-line
365365
$part .= '--mixed-' . $this->getBoundary() . $crlf;
366366
$part .= 'Content-ID: ' . $cid . $crlf;
367367
$part .= 'Content-Type: ' . $this->getContentType($filename) . $crlf;

0 commit comments

Comments
 (0)