getTokens(); if (T_WHITESPACE !== $tokens[$stackPtr - 1]['code'] && !in_array($tokens[$stackPtr - 1]['content'], [ TokenizerSymbolsInterface::INDENT_SPACES, TokenizerSymbolsInterface::NEW_LINE, ]) ) { return; } $className = $tokens[$stackPtr + 1]['content']; if (preg_match_all('/[^a-z0-9\-_]/U', $className, $matches)) { $phpcsFile->addError('Class name contains not allowed symbols', $stackPtr, 'NotAllowedSymbol', $matches); } } }