*/ public function register() { return Collections::ooHierarchyKeywords(); } /** * Processes this test, when one of its tokens is encountered. * * @since 7.1.4 * * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * * @return void */ public function process(File $phpcsFile, $stackPtr) { if (ScannedCode::shouldRunOnOrBelow('5.4') === false) { return; } $tokens = $phpcsFile->getTokens(); $tokenContentLC = \strtolower($tokens[$stackPtr]['content']); if ($tokenContentLC !== $tokens[$stackPtr]['content']) { $phpcsFile->addError( 'The keyword \'%s\' was treated in a case-sensitive fashion in certain cases in PHP 5.4 or earlier. Use the lowercase version for consistent support.', $stackPtr, 'NonLowercaseFound', [$tokenContentLC] ); } } }