1 | <?php |
||
24 | class Controller extends AbstractController |
||
25 | { |
||
26 | /** @var MailService $mailService */ |
||
27 | private $mailService; |
||
28 | |||
29 | /** @var MySQL */ |
||
30 | protected $_db; |
||
31 | |||
32 | /** @var Environment $serverEnvironment */ |
||
33 | protected $serverEnvironment; |
||
34 | |||
35 | /** @var Logger[] $log */ |
||
36 | protected $log; |
||
37 | |||
38 | protected $translator; |
||
39 | |||
40 | /** |
||
41 | * Controller constructor. |
||
42 | * @param ServerRequestInterface $request |
||
43 | * @throws \Exception |
||
44 | */ |
||
45 | 33 | public function __construct(ServerRequestInterface $request) |
|
51 | |||
52 | /** |
||
53 | * @return MailService |
||
54 | */ |
||
55 | 1 | public function getMailService() |
|
63 | |||
64 | 1 | private function initMailService() |
|
75 | |||
76 | /** |
||
77 | * runs before th' controller action |
||
78 | */ |
||
79 | 24 | public function init() |
|
83 | |||
84 | /** |
||
85 | * runs after yer work is done |
||
86 | */ |
||
87 | 24 | public function postDispatch() |
|
91 | |||
92 | /** |
||
93 | * @return array |
||
94 | */ |
||
95 | 1 | public function indexAction() |
|
99 | |||
100 | 2 | public function errorAction() |
|
107 | |||
108 | 1 | public function notFoundAction() |
|
114 | |||
115 | /** |
||
116 | * @param string $channel |
||
117 | * @return Logger |
||
118 | */ |
||
119 | 2 | public function getLog($channel = 'default'): Logger |
|
131 | |||
132 | /** |
||
133 | * @throws \Exception |
||
134 | */ |
||
135 | 33 | private function initLogs() |
|
144 | |||
145 | /** |
||
146 | * @return \Zend\I18n\Translator\Translator |
||
147 | */ |
||
148 | 3 | public function getTranslator() |
|
156 | |||
157 | 33 | private function initTranslator() |
|
173 | } |
||
174 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.