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('Class name does not match format "%s"', $this->format));
}
}