1 | <?php |
||
13 | class ModifyPlugin implements Swift_Events_SendListener |
||
14 | { |
||
15 | /** |
||
16 | * @var callable |
||
17 | */ |
||
18 | private $modifier; |
||
19 | |||
20 | /** |
||
21 | * @param callable $modifier |
||
22 | */ |
||
23 | 2 | function __construct(callable $modifier) |
|
27 | |||
28 | /** |
||
29 | * @return callable |
||
30 | */ |
||
31 | 1 | public function getModifier() |
|
35 | |||
36 | /** |
||
37 | * Apply the modifier to the Swift_Message |
||
38 | * |
||
39 | * @param Swift_Events_SendEvent $evt |
||
40 | */ |
||
41 | 1 | public function beforeSendPerformed(Swift_Events_SendEvent $evt) |
|
47 | |||
48 | /** |
||
49 | * Do nothing |
||
50 | * |
||
51 | * @param Swift_Events_SendEvent $evt |
||
52 | */ |
||
53 | 1 | public function sendPerformed(Swift_Events_SendEvent $evt) |
|
57 | } |
||
58 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.