1 | <?php |
||
28 | class ActivationController |
||
29 | { |
||
30 | /** |
||
31 | * @var EngineInterface |
||
32 | */ |
||
33 | private $templating; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $changePasswordActionTemplate; |
||
39 | |||
40 | /** |
||
41 | * @var UserRepositoryInterface |
||
42 | */ |
||
43 | private $userRepository; |
||
44 | |||
45 | /** |
||
46 | * @var RouterInterface |
||
47 | */ |
||
48 | private $router; |
||
49 | |||
50 | /** |
||
51 | * @var FormFactoryInterface |
||
52 | */ |
||
53 | private $formFactory; |
||
54 | |||
55 | /** |
||
56 | * @var EventDispatcherInterface |
||
57 | */ |
||
58 | private $eventDispatcher; |
||
59 | |||
60 | /** |
||
61 | * @var FlashMessages |
||
62 | */ |
||
63 | private $flashMessages; |
||
64 | |||
65 | /** |
||
66 | * @var string |
||
67 | */ |
||
68 | private $changePasswordFormType; |
||
69 | |||
70 | /** |
||
71 | * @var array |
||
72 | */ |
||
73 | private $changePasswordFormValidationGroups; |
||
74 | |||
75 | /** |
||
76 | * @param EngineInterface $templating |
||
77 | * @param string $changePasswordActionTemplate |
||
78 | * @param UserRepositoryInterface $userRepository |
||
79 | * @param RouterInterface $router |
||
80 | * @param FormFactoryInterface $formFactory |
||
81 | * @param EventDispatcherInterface $eventDispatcher |
||
82 | * @param FlashMessages $flashMessages |
||
83 | * @param string $changePasswordFormType |
||
84 | * @param array $changePasswordFormValidationGroups |
||
85 | */ |
||
86 | public function __construct( |
||
107 | |||
108 | /** |
||
109 | * @param string $token |
||
110 | * @return RedirectResponse |
||
111 | */ |
||
112 | public function activateAction($token) |
||
131 | |||
132 | /** |
||
133 | * @param Request $request |
||
134 | * @param string $token |
||
135 | * @return RedirectResponse|Response |
||
136 | */ |
||
137 | public function changePasswordAction(Request $request, $token) |
||
170 | |||
171 | /** |
||
172 | * @param $token |
||
173 | * @return ActivableInterface|null |
||
174 | */ |
||
175 | private function tryFindUserByActivationToken($token) |
||
193 | |||
194 | /** |
||
195 | * @param string $type |
||
196 | * @param string $message |
||
197 | * @return RedirectResponse |
||
198 | */ |
||
199 | private function addFlashAndRedirect($type, $message) |
||
205 | |||
206 | /** |
||
207 | * @param $user |
||
208 | * @return bool |
||
209 | */ |
||
210 | private function isUserEnforcedToChangePassword($user) |
||
214 | } |
||
215 |
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: