src/Fixer/Casing/MagicMethodCasingFixer.php
private function isFunctionSignature(Tokens $tokens, $index)
    {
        $prevIndex = $tokens->getPrevMeaningfulToken($index);
        if (!$tokens[$prevIndex]->isGivenKind(T_FUNCTION)) {
            return false; // not a method signature
        }

        return $tokens[$tokens->getNextMeaningfulToken($index)]->equals('(');
    }
private function isFunctionSignature(Tokens $tokens, $index)
    {
        $prevIndex = $tokens->getPrevMeaningfulToken($index);
        if (!$tokens[$prevIndex]->isGivenKind(T_FUNCTION)) {
            return false; // not a method signature
        }

        return $tokens[$tokens->getNextMeaningfulToken($index)]->equals('(');
    }
@param Tokens $tokens
@param int    $index

@return bool