ObjectCalisthenics\Sniffs\Metrics\OneIndentationLevelSniff::process PHP Method

process() public method

public process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr )
$phpcsFile PHP_CodeSniffer_File
$stackPtr integer
    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $this->phpcsFile = $phpcsFile;
        $this->stackPtr = $stackPtr;
        $this->nestingLevel = 0;
        $this->ignoredScopeStack = [];
        $tokens = $phpcsFile->getTokens();
        $token = $tokens[$stackPtr];
        // Ignore abstract methods.
        if (isset($token['scope_opener']) === false) {
            return;
        }
        $this->iterateTokens($token['scope_opener'], $token['scope_closer'], $tokens);
        $this->nestingLevel = $this->subtractFunctionNestingLevel($token);
        $this->handleNestingLevel($this->nestingLevel);
    }