1 | <?php |
||
20 | class Translations implements TranslationsInterface |
||
21 | { |
||
22 | /** |
||
23 | * Domain translation name. |
||
24 | * |
||
25 | * This variable avoids the use of global |
||
26 | * constants and it's extensible in an easy way. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected static $domain = 'WP Foundation default domain'; |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | public static function trans($key) |
||
49 | |||
50 | /** |
||
51 | * Returns the domain defined into TRANSLATION_DOMAIN global |
||
52 | * const or otherwise the value of domain static variable. |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | private static function domain() |
||
60 | } |
||
61 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.