'constants', 'property' => 'class properties', 'staticvar' => 'static variables', 'default' => 'default parameter values', ); /** * Do a version check to determine if this sniff needs to run at all. * * @since 8.2.0 * * @return bool */ protected function bowOutEarly() { return ($this->supportsBelow('5.2') !== true); } /** * Is a value declared and does the declared value not contain an heredoc ? * * @since 8.2.0 * * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * @param int $end The end of the value definition. * * @return bool True if no heredoc (or assignment) is found, false otherwise. */ protected function isValidAssignment(File $phpcsFile, $stackPtr, $end) { $tokens = $phpcsFile->getTokens(); $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), $end, true); if ($next === false || $tokens[$next]['code'] !== \T_EQUAL) { // No value assigned. return true; } return ($phpcsFile->findNext(\T_START_HEREDOC, ($next + 1), $end, false, null, true) === false); } }