| 1 | <?php namespace nyx\notify\transports\mail\drivers; |
||
| 15 | class Log implements mail\interfaces\Driver |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * The traits of a Log Mail Driver instance. |
||
| 19 | */ |
||
| 20 | use traits\CountsRecipients; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var \Psr\Log\LoggerInterface The Logger used to log Messages to. |
||
| 24 | */ |
||
| 25 | protected $logger; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Creates a new Log Mail Driver instance. |
||
| 29 | * |
||
| 30 | * @param \Psr\Log\LoggerInterface $logger The Logger to log Messages to. |
||
| 31 | */ |
||
| 32 | public function __construct(\Psr\Log\LoggerInterface $logger) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritdoc} |
||
| 39 | */ |
||
| 40 | public function send(\Swift_Mime_Message $message, &$failedRecipients = null) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Returns the MIME data of a MIME entity represented as a MIME string. Supports nested entities. |
||
| 49 | * |
||
| 50 | * @param \Swift_Mime_MimeEntity $entity |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | protected function getMimeEntityString(\Swift_Mime_MimeEntity $entity) : string |
||
| 63 | } |
||
| 64 |
Let’s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let’s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: