| Total Complexity | 7 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 14 | class Mail extends \Swift_Message |
||
| 15 | { |
||
| 16 | /** @var Mailer */ |
||
| 17 | protected $mailer; |
||
| 18 | |||
| 19 | public function __construct(Mailer $mailer) |
||
| 20 | { |
||
| 21 | $this->mailer = $mailer; |
||
| 22 | |||
| 23 | parent::__construct(); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Attach files. |
||
| 28 | * |
||
| 29 | * @param array $filePaths |
||
| 30 | * |
||
| 31 | * @return $this |
||
| 32 | */ |
||
| 33 | public function attachFiles(array $filePaths): self |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Attach file. |
||
| 44 | * |
||
| 45 | * @param string $filePath |
||
| 46 | * @param string|null $alias |
||
| 47 | * |
||
| 48 | * @return self |
||
| 49 | */ |
||
| 50 | public function attachFile(string $filePath, string $alias = null): self |
||
| 51 | { |
||
| 52 | return $this->attach( |
||
| 53 | \Swift_Attachment::fromPath($filePath)->setFilename($alias ?? \basename($filePath)) |
||
| 54 | ); |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Attach raw data. |
||
| 59 | * |
||
| 60 | * @param string $data |
||
| 61 | * @param string $alias |
||
| 62 | * @param string $type |
||
| 63 | * |
||
| 64 | * @return self |
||
| 65 | */ |
||
| 66 | public function attachRaw(string $data, string $alias, string $type): self |
||
| 70 | ); |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Mail the mail with swift mailer. |
||
| 75 | * |
||
| 76 | * @return int The count of mailed recipients. |
||
| 77 | */ |
||
| 78 | public function mail() |
||
| 83 |