/**
* visitToken(): defined by TokenRuleInterface.
*
* @see TokenRuleInterface::visitToken()
* @param File $file
* @return void
*/
public function visitToken(File $file)
{
if (!$file->seekTokenType(T_STRING, false, ';')) {
return;
}
$token = $file->current();
if (!preg_match('(^' . $this->format . '$)', $token->getLexeme())) {
$this->addViolation($file, $token->getLine(), $token->getColumn(), sprintf('Constant name does not match format "%s"', $this->format));
}
}