1 | <?php |
||
25 | class Dispatcher extends Singleton |
||
26 | { |
||
27 | /** |
||
28 | * @Inyectable |
||
29 | * @var \PSFS\base\Security $security |
||
30 | */ |
||
31 | protected $security; |
||
32 | /** |
||
33 | * @Inyectable |
||
34 | * @var \PSFS\base\Router $router |
||
35 | */ |
||
36 | protected $router; |
||
37 | /** |
||
38 | * @Inyectable |
||
39 | * @var \PSFS\base\Request $parser |
||
40 | */ |
||
41 | protected $parser; |
||
42 | /** |
||
43 | * @Inyectable |
||
44 | * @var \PSFS\base\Logger $log |
||
45 | */ |
||
46 | protected $log; |
||
47 | /** |
||
48 | * @Inyectable |
||
49 | * @var \PSFS\base\config\Config $config |
||
50 | */ |
||
51 | protected $config; |
||
52 | |||
53 | protected $ts; |
||
|
|||
54 | protected $mem; |
||
55 | protected $locale = "es_ES"; |
||
56 | |||
57 | private $actualUri; |
||
58 | |||
59 | /** |
||
60 | * Initializer method |
||
61 | */ |
||
62 | public function init() |
||
72 | |||
73 | /** |
||
74 | * Method that assign the locale to the request |
||
75 | * @return $this |
||
76 | */ |
||
77 | private function setLocale() |
||
94 | |||
95 | /** |
||
96 | * Run method |
||
97 | * @return string HTML |
||
98 | */ |
||
99 | public function run() |
||
122 | |||
123 | private function redirectToHome() |
||
127 | |||
128 | /** |
||
129 | * Method that convert an exception to html |
||
130 | * |
||
131 | * @param \Exception $e |
||
132 | * |
||
133 | * @return string HTML |
||
134 | */ |
||
135 | protected function dumpException(\Exception $e) |
||
149 | |||
150 | /** |
||
151 | * Method that returns the memory used at this specific moment |
||
152 | * |
||
153 | * @param $unit string |
||
154 | * |
||
155 | * @return int |
||
156 | */ |
||
157 | public function getMem($unit = "Bytes") |
||
173 | |||
174 | /** |
||
175 | * Method that returns the seconds spent with the script |
||
176 | * @return double |
||
177 | */ |
||
178 | public function getTs() |
||
182 | |||
183 | /** |
||
184 | * Debug function to catch warnings as exceptions |
||
185 | */ |
||
186 | protected function bindWarningAsExceptions() |
||
197 | |||
198 | /** |
||
199 | * Stats initializer |
||
200 | */ |
||
201 | private function initiateStats() |
||
211 | |||
212 | } |
||
213 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.