Total Complexity | 8 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
13 | class FileMailer implements Mail\IMailer |
||
|
|||
14 | { |
||
15 | |||
16 | /** @var string */ |
||
17 | private $path; |
||
18 | |||
19 | /** @var string|null */ |
||
20 | private $live; |
||
21 | |||
22 | /** @var string */ |
||
23 | private $lastFile; |
||
24 | |||
25 | |||
26 | public function __construct(string $path) |
||
27 | { |
||
28 | Utils\FileSystem::createDir($path); |
||
29 | $this->path = realpath($path) . DIRECTORY_SEPARATOR; |
||
30 | } |
||
31 | |||
32 | |||
33 | public function setLive(string $live): void |
||
36 | } |
||
37 | |||
38 | |||
39 | public function getLastFile(): string |
||
42 | } |
||
43 | |||
44 | |||
45 | public function send(Mail\Message $mail): void |
||
46 | { |
||
47 | $this->autoremove(); |
||
48 | list($sec) = explode(' ', substr(microtime(), 2)); |
||
49 | $this->lastFile = $this->path . date('Y-m-d_H-i-s-') . $sec . '.eml'; |
||
50 | file_put_contents($this->lastFile, $mail->generateMessage()); |
||
51 | } |
||
52 | |||
53 | |||
54 | private function autoremove(): void |
||
68 | } |
||
69 | |||
70 | } |
||
71 |
This interface has been deprecated. The supplier of the interface has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.