1 | <?php |
||
14 | class CustomTranslateExtension extends \Twig_Extension { |
||
15 | use SingletonTrait; |
||
16 | |||
17 | const CUSTOM_LOCALE_SESSION_KEY = '__PSFS_CUSTOM_LOCALE_KEY__'; |
||
18 | |||
19 | protected static $translations = []; |
||
20 | protected static $locale = 'es_ES'; |
||
21 | protected static $generate = false; |
||
22 | protected static $filename = ''; |
||
23 | |||
24 | /** |
||
25 | * @param string $custom_key |
||
|
|||
26 | * @param bool $force_reload |
||
27 | * @param bool $use_base |
||
28 | */ |
||
29 | 1 | protected static function checkLoad($custom_key = null, $force_reload = false, $use_base = false) { |
|
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | 1 | public function getTokenParsers() |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function getFilters() |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function getName() |
||
74 | { |
||
75 | return 'PSFSi18n'; |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @param $message |
||
80 | * @param string $custom_key |
||
81 | * @param bool $force_reload |
||
82 | * @return mixed|string |
||
83 | */ |
||
84 | 1 | public static function _($message, $custom_key = null, $force_reload = false) { |
|
96 | |||
97 | /** |
||
98 | * @param string $message |
||
99 | * @param string $translation |
||
100 | */ |
||
101 | protected static function generate($message, $translation) { |
||
107 | } |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.