PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::fixFunctionDefinition PHP Method

fixFunctionDefinition() private method

private fixFunctionDefinition ( Tokens $tokens, integer $startIndex, integer $endIndex )
$tokens PhpCsFixer\Tokenizer\Tokens
$startIndex integer
$endIndex integer
    private function fixFunctionDefinition(Tokens $tokens, $startIndex, $endIndex)
    {
        $lastArgumentIndex = $this->getLastNonDefaultArgumentIndex($tokens, $startIndex, $endIndex);
        if (!$lastArgumentIndex) {
            return;
        }
        for ($i = $lastArgumentIndex; $i > $startIndex; --$i) {
            $token = $tokens[$i];
            if ($token->isGivenKind(T_VARIABLE)) {
                $lastArgumentIndex = $i;
                continue;
            }
            if (!$token->equals('=') || $this->isTypehintedNullableVariable($tokens, $i)) {
                continue;
            }
            $endIndex = $tokens->getPrevTokenOfKind($lastArgumentIndex, array(','));
            $endIndex = $tokens->getPrevMeaningfulToken($endIndex);
            $this->removeDefaultArgument($tokens, $i, $endIndex);
        }
    }