We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de3c0ca commit dba7c18Copy full SHA for dba7c18
src/Messaging/Mail/LocalFileAttachment.php
@@ -24,13 +24,13 @@ class LocalFileAttachment implements AttachmentInterface
24
/**
25
* Attachment constructor.
26
* @param string $filepath
27
- * @throws ExternalFileException
+ * @param string|null $name
28
* @throws FileDoesNotExistException
29
*/
30
- public function __construct(string $filepath)
+ public function __construct(string $filepath, string $name = null)
31
{
32
$this->validate($filepath);
33
- $this->name = basename($filepath);
+ $this->name = $name ?? basename($filepath);
34
$this->content = base64_encode(rtrim(file_get_contents($filepath)));
35
}
36
0 commit comments