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, &$failures = 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:
and let’s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are 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.php
However, as
OtherDir/Foo.php
does 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: