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); } if (!empty(strpos($className, self::STRING_HELPER_CLASSES_PREFIX)) && empty(strpos($className, self::STRING_ALLOWED_UNDERSCORES)) ) { $phpcsFile->addError('"_" symbol allowed only for helper classes', $stackPtr, 'UnderscoreSymbol'); } } }