src/JsPhpize/Lexer/Scanner.php
The class Scanner has 11 public methods. Consider refactoring Scanner to keep number of public methods under 10. Open
Open
class Scanner
{
public function scanUnexpected($matches)
{
throw $this->unexpected($this->valueToken('token', $matches));
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open
Open
return $this->valueToken('newline', $matches);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::typeToken
Open
Open
return $this->typeToken($matches);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open
Open
return $this->valueToken('variable', $matches);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open
Open
return $this->valueToken('regexp', $matches);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open
Open
return $this->valueToken('keyword', $matches);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open
Open
return $this->valueToken('number', $matches);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::unexpected
Open
Open
throw $this->unexpected($this->valueToken('token', $matches));
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::exceptionInfos
Open
Open
throw new Exception('Constants cannot start with ' . $constPrefix . ', this prefix is reserved for JsPhpize' . $this->exceptionInfos(), 1);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::token
Open
Open
return $this->token('constant', $constant);
- Exclude checks
Reference to undeclared property \JsPhpize\Lexer\Scanner->engine
Open
Open
$constPrefix = $this->engine->getOption('constPrefix', JsPhpize::CONST_PREFIX);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::consume
Open
Open
$this->consume($matches[0]);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::exceptionInfos
Open
Open
throw new Exception('Variables cannot start with ' . $varPrefix . ', this prefix is reserved for JsPhpize' . $this->exceptionInfos(), 4);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open
Open
return $this->valueToken('lambda', $matches);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open
Open
return $this->valueToken('string', $matches);
- Exclude checks
Reference to undeclared property \JsPhpize\Lexer\Scanner->engine
Open
Open
$varPrefix = $this->engine->getOption('varPrefix', JsPhpize::VAR_PREFIX);
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open
Open
throw $this->unexpected($this->valueToken('token', $matches));
- Exclude checks
Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open
Open
return $this->valueToken('comment', $matches);
- Exclude checks
Reference to undeclared property \JsPhpize\Lexer\Scanner->engine
Open
Open
if ($this->engine->getOption('ignoreDollarVariable') && mb_substr($matches[0], 0, 1) === '$') {
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
Open
throw new Exception('Constants cannot start with ' . $constPrefix . ', this prefix is reserved for JsPhpize' . $this->exceptionInfos(), 1);
- Exclude checks
Line exceeds 120 characters; contains 149 characters Open
Open
throw new Exception('Variables cannot start with ' . $varPrefix . ', this prefix is reserved for JsPhpize' . $this->exceptionInfos(), 4);
- Exclude checks