| Total Complexity | 13 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class Localization_Parser_Token_Javascript extends Localization_Parser_Token |
||
| 10 | { |
||
| 11 | protected function parseDefinition() : void |
||
| 12 | { |
||
| 13 | // some entries are strings, like parenthesises, semicolons and the like. |
||
| 14 | if(is_string($this->definition)) |
||
| 15 | { |
||
| 16 | $this->token = $this->definition; |
||
| 17 | $this->value = null; |
||
| 18 | |||
| 19 | if(isset($this->parentToken)) { |
||
| 20 | $this->line = $this->parentToken->getLine(); |
||
|
|
|||
| 21 | } |
||
| 22 | } |
||
| 23 | else |
||
| 24 | { |
||
| 25 | $this->token = JTokenizer::getTokenName($this->definition[0]); |
||
| 26 | $this->value = $this->definition[1]; |
||
| 27 | $this->line = $this->definition[2]; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getFunctionNames() : array |
||
| 32 | { |
||
| 33 | return array( |
||
| 34 | 't' |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function isOpeningFuncParams() : bool |
||
| 39 | { |
||
| 40 | return $this->getToken() === '('; |
||
| 41 | } |
||
| 42 | |||
| 43 | public function isClosingFuncParams() : bool |
||
| 44 | { |
||
| 45 | return $this->getToken() === ')'; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function isEncapsedString() : bool |
||
| 49 | { |
||
| 50 | return $this->token === 'J_STRING_LITERAL'; |
||
| 51 | } |
||
| 52 | |||
| 53 | public function isTranslationFunction() : bool |
||
| 54 | { |
||
| 55 | return $this->isVariableOrFunction() && isset($this->nameLookup[$this->getValue()]); |
||
| 56 | } |
||
| 57 | |||
| 58 | public function isVariableOrFunction() : bool |
||
| 59 | { |
||
| 60 | return $this->token === 'J_IDENTIFIER' || $this->token === 'J_FUNCTION'; |
||
| 61 | } |
||
| 62 | |||
| 63 | public function isExplanationFunction() : bool |
||
| 66 | } |
||
| 67 | |||
| 68 | public function isArgumentSeparator() : bool |
||
| 71 | } |
||
| 72 | } |
||
| 73 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.