1 | <?php |
||
15 | class EmailUpdateListener |
||
16 | { |
||
17 | /** |
||
18 | * @var EmailUpdateConfirmation |
||
19 | */ |
||
20 | private $emailUpdateConfirmation; |
||
21 | /** |
||
22 | * @var RequestStack |
||
23 | */ |
||
24 | private $requestStack; |
||
25 | /** |
||
26 | * @var CanonicalFieldsUpdater |
||
27 | */ |
||
28 | private $canonicalFieldsUpdater; |
||
29 | /** |
||
30 | * @var EmailUpdateConfirmationMailerInterface |
||
31 | */ |
||
32 | private $mailer; |
||
33 | |||
34 | /** |
||
35 | * Constructor. |
||
36 | * |
||
37 | * @param EmailUpdateConfirmation $emailUpdateConfirmation |
||
38 | * @param RequestStack $requestStack |
||
39 | * @param CanonicalFieldsUpdater $canonicalFieldsUpdater |
||
40 | * @param EmailUpdateConfirmationMailerInterface $mailer |
||
41 | */ |
||
42 | public function __construct(EmailUpdateConfirmation $emailUpdateConfirmation, RequestStack $requestStack, CanonicalFieldsUpdater $canonicalFieldsUpdater, EmailUpdateConfirmationMailerInterface $mailer) |
||
49 | |||
50 | /** |
||
51 | * Pre update listener based on doctrine common. |
||
52 | * |
||
53 | * @param PreUpdateEventArgs $args |
||
54 | */ |
||
55 | public function preUpdate(PreUpdateEventArgs $args) |
||
78 | } |
||
79 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: