extensions/felixfbecker.php-intellisense-0.0.12/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php
/**
     * Processes this test, when one of its tokens is encountered.
     *
     * @param PHP_CodeSniffer_File $phpcsFile The current file being processed.
     * @param int                  $stackPtr  The position of the current token in the
     *                                        stack passed in $tokens.
     *
     * @return void
     */
Processes this test, when one of its tokens is encountered.
@param PHP_CodeSniffer_File $phpcsFile The current file being processed.
@param int                  $stackPtr  The position of the current token in the
stack passed in $tokens.

@return void
Processes this test when one of its tokens is encountered . @param PHP_CodeSniffer_File $phpcsFile The current file being processed . @param int $stackPtr The position of the current token in the stack passed in $tokens . @return void
public function process(File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();
        $properties   = array();
        $wantedTokens = array(
                         T_PROPERTY,
                         T_OBJECT,
                        );
        $next = $phpcsFile->findNext($wantedTokens, ($stackPtr + 1), $tokens[$stackPtr]['bracket_closer']);
        while ($next !== false && $next < $tokens[$stackPtr]['bracket_closer']) {
            if ($tokens[$next]['code'] === T_OBJECT) {
                $next = $tokens[$next]['bracket_closer'];
            } else {
                $propName = $tokens[$next]['content'];
                if (isset($properties[$propName]) === true) {
                    $error = 'Duplicate property definition found for "%s"; previously defined on line %s';
                    $data  = array(
                              $propName,
                              $tokens[$properties[$propName]]['line'],
                             );
                    $phpcsFile->addError($error, $next, 'Found', $data);
                }
                $properties[$propName] = $next;
            }
            $next = $phpcsFile->findNext($wantedTokens, ($next + 1), $tokens[$stackPtr]['bracket_closer']);
        }
    }
public function process ( File $ phpcsFile , $ stackPtr ) { $ tokens = $ phpcsFile -> getTokens ( ) ; $ properties = array ( ) ; $ wantedTokens = array ( T_PROPERTY , T_OBJECT , ) ; $ next = $ phpcsFile -> findNext ( $ wantedTokens , ( $ stackPtr + 1 ) , $ tokens [ $ stackPtr ] [ 'bracket_closer' ] ) ; while ( $ next !== false && $ next < $ tokens [ $ stackPtr ] [ 'bracket_closer' ] ) { if ( $ tokens [ $ next ] [ 'code' ] === T_OBJECT ) { $ next = $ tokens [ $ next ] [ 'bracket_closer' ] ; } else { $ propName = $ tokens [ $ next ] [ 'content' ] ; if ( isset ( $ properties [ $ propName ] ) === true ) { $ error = 'Duplicate property definition found for "%s"; previously defined on line %s' ; $ data = array ( $ propName , $ tokens [ $ properties [ $ propName ] ] [ 'line' ] , ) ; $ phpcsFile -> addError ( $ error , $ next , 'Found' , $ data ) ; } $ properties [ $ propName ] = $ next ; } $ next = $ phpcsFile -> findNext ( $ wantedTokens , ( $ next + 1 ) , $ tokens [ $ stackPtr ] [ 'bracket_closer' ] ) ; } }
Processes this test, when one of its tokens is encountered.
Processes this test when one of its tokens is encountered .
// Skip nested objects. //end if //end while