1 | <?php |
||
12 | class Generic extends \Twig_Extension |
||
13 | { |
||
14 | /** |
||
15 | * @var ContainerInterface |
||
16 | */ |
||
17 | protected $container; |
||
18 | |||
19 | /** |
||
20 | * @var PhoneNumberFormatHelper |
||
21 | */ |
||
22 | protected $phoneNumberHelper; |
||
23 | |||
24 | /** |
||
25 | * @var SettingsHelper |
||
26 | */ |
||
27 | protected $settingsHelper; |
||
28 | |||
29 | public function __construct(ContainerInterface $container) |
||
35 | |||
36 | /** |
||
37 | * @inheritdoc |
||
38 | */ |
||
39 | public function getGlobals() |
||
44 | |||
45 | /** |
||
46 | * @inheritdoc |
||
47 | */ |
||
48 | public function getFunctions() |
||
67 | |||
68 | public function getFilters() |
||
78 | |||
79 | /** |
||
80 | * @param $key |
||
81 | * @param string $default |
||
82 | * |
||
83 | * @return null|mixed |
||
84 | */ |
||
85 | public function getSettingsParameter($key, $default = null) |
||
99 | |||
100 | public function getRandomString($length = 8) |
||
111 | |||
112 | /** |
||
113 | * @param PhoneNumber $phoneNumber |
||
114 | * @param int $defaultRegion |
||
115 | * |
||
116 | * @return null|string |
||
117 | */ |
||
118 | public function getPhoneFormat( |
||
128 | |||
129 | /** |
||
130 | * @param $total |
||
131 | * @param $pie |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | public function calculatePercent($total, $pie) |
||
149 | |||
150 | /** |
||
151 | * @param $email |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | public function getObfuscatedEmail($email) |
||
163 | |||
164 | /** |
||
165 | * @param $context |
||
166 | * @param $path |
||
167 | * |
||
168 | * @return mixed |
||
169 | */ |
||
170 | public function getContextValue($context, $path) |
||
176 | |||
177 | /** |
||
178 | * @param $string |
||
179 | * |
||
180 | * @return string |
||
181 | */ |
||
182 | public function cleanWhiteSpace($string) |
||
186 | |||
187 | public function match($subject, $pattern) |
||
191 | |||
192 | public function dumpExit($val) |
||
197 | |||
198 | /** |
||
199 | * @api |
||
200 | */ |
||
201 | public function getName() |
||
205 | } |
||
206 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.