*/ public function register() { return [\T_INLINE_THEN]; } /** * Processes this test, when one of its tokens is encountered. * * @since 7.0.0 * * @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.2') === false) { return; } if (Operators::isShortTernary($phpcsFile, $stackPtr) === false) { return; } $phpcsFile->addError( 'Middle may not be omitted from ternary operators in PHP < 5.3', $stackPtr, 'MiddleMissing' ); } }