1 | <?php |
||
16 | class Swift_Transport_NullTransport implements Swift_Transport |
||
|
|||
17 | { |
||
18 | /** The event dispatcher from the plugin API */ |
||
19 | private $_eventDispatcher; |
||
20 | |||
21 | /** |
||
22 | * Constructor. |
||
23 | * |
||
24 | * @param Swift_Events_EventDispatcher $eventDispatcher |
||
25 | */ |
||
26 | 1 | public function __construct(Swift_Events_EventDispatcher $eventDispatcher) |
|
30 | |||
31 | /** |
||
32 | * Tests if this Transport mechanism has started. |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | public function isStarted() |
||
40 | |||
41 | /** |
||
42 | * Starts this Transport mechanism. |
||
43 | */ |
||
44 | public function start() |
||
47 | |||
48 | /** |
||
49 | * Stops this Transport mechanism. |
||
50 | */ |
||
51 | public function stop() |
||
54 | |||
55 | /** |
||
56 | * Sends the given message. |
||
57 | * |
||
58 | * @param Swift_Mime_Message $message |
||
59 | * @param string[] $failedRecipients An array of failures by-reference |
||
60 | * |
||
61 | * @return int The number of sent emails |
||
62 | */ |
||
63 | public function send(Swift_Mime_Message $message, &$failedRecipients = null) |
||
64 | { |
||
65 | $evt = $this->_eventDispatcher->createSendEvent($this, $message); |
||
66 | if ($evt) { |
||
67 | |||
68 | $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); |
||
69 | if ($evt->bubbleCancelled()) { |
||
70 | return 0; |
||
71 | } |
||
72 | } |
||
73 | |||
74 | if ($evt) { |
||
75 | $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); |
||
76 | $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); |
||
77 | } |
||
78 | |||
79 | $count = ( |
||
80 | count((array)$message->getTo()) |
||
81 | + count((array)$message->getCc()) |
||
82 | + count((array)$message->getBcc()) |
||
83 | ); |
||
84 | |||
85 | return $count; |
||
86 | } |
||
87 | |||
88 | /** |
||
89 | * Register a plugin. |
||
90 | * |
||
91 | * @param Swift_Events_EventListener $plugin |
||
92 | */ |
||
93 | public function registerPlugin(Swift_Events_EventListener $plugin) |
||
97 | } |
||
98 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.