protected static function getSingleCall(array $frame, $argc)
    {
        if (!isset($frame['file'], $frame['line'], $frame['function']) || !\is_readable($frame['file'])) {
            return null;
        }

        if (empty($frame['class'])) {
            $callfunc = $frame['function'];
        } else {
            $callfunc = array($frame['class'], $frame['function']);
        }

        $calls = CallFinder::getFunctionCalls(
            \file_get_contents($frame['file']),
            $frame['line'],
            $callfunc
        );

        $return = null;

        foreach ($calls as $call) {
            $is_unpack = false;

            // Handle argument unpacking as a last resort
            if (KINT_PHP56) {
                foreach ($call['parameters'] as $i => &$param) {
                    if (0 === \strpos($param['name'], '...')) {
                        if ($i < $argc && $i === \count($call['parameters']) - 1) {
                            for ($j = 1; $j + $i < $argc; ++$j) {
                                $call['parameters'][] = array(
                                    'name' => 'array_values('.\substr($param['name'], 3).')['.$j.']',
                                    'path' => 'array_values('.\substr($param['path'], 3).')['.$j.']',
                                    'expression' => false,
                                );
                            }

                            $param['name'] = 'reset('.\substr($param['name'], 3).')';
                            $param['path'] = 'reset('.\substr($param['path'], 3).')';
                            $param['expression'] = false;
                        } else {
                            $call['parameters'] = \array_slice($call['parameters'], 0, $i);
                        }

                        $is_unpack = true;
                        break;
                    }

                    if ($i >= $argc) {
                        continue 2;
                    }
                }
            }

            if ($is_unpack || \count($call['parameters']) === $argc) {
                if (null === $return) {
                    $return = $call;
                } else {
                    // If we have multiple calls on the same line with the same amount of arguments,
                    // we can't be sure which it is so just return null and let them figure it out
                    return null;
                }
            }
        }

        return $return;
    }
protected static function getSingleCall(array $frame, $argc)
    {
        if (!isset($frame['file'], $frame['line'], $frame['function']) || !\is_readable($frame['file'])) {
            return null;
        }

        if (empty($frame['class'])) {
            $callfunc = $frame['function'];
        } else {
            $callfunc = array($frame['class'], $frame['function']);
        }

        $calls = CallFinder::getFunctionCalls(
            \file_get_contents($frame['file']),
            $frame['line'],
            $callfunc
        );

        $return = null;

        foreach ($calls as $call) {
            $is_unpack = false;

            // Handle argument unpacking as a last resort
            if (KINT_PHP56) {
                foreach ($call['parameters'] as $i => &$param) {
                    if (0 === \strpos($param['name'], '...')) {
                        if ($i < $argc && $i === \count($call['parameters']) - 1) {
                            for ($j = 1; $j + $i < $argc; ++$j) {
                                $call['parameters'][] = array(
                                    'name' => 'array_values('.\substr($param['name'], 3).')['.$j.']',
                                    'path' => 'array_values('.\substr($param['path'], 3).')['.$j.']',
                                    'expression' => false,
                                );
                            }

                            $param['name'] = 'reset('.\substr($param['name'], 3).')';
                            $param['path'] = 'reset('.\substr($param['path'], 3).')';
                            $param['expression'] = false;
                        } else {
                            $call['parameters'] = \array_slice($call['parameters'], 0, $i);
                        }

                        $is_unpack = true;
                        break;
                    }

                    if ($i >= $argc) {
                        continue 2;
                    }
                }
            }

            if ($is_unpack || \count($call['parameters']) === $argc) {
                if (null === $return) {
                    $return = $call;
                } else {
                    // If we have multiple calls on the same line with the same amount of arguments,
                    // we can't be sure which it is so just return null and let them figure it out
                    return null;
                }
            }
        }

        return $return;
    }
protected static function getSingleCall ( array $ frame , $ argc ) { if ( ! isset ( $ frame [ 'file' ] , $ frame [ 'line' ] , $ frame [ 'function' ] ) || ! \ is_readable ( $ frame [ 'file' ] ) ) { return null ; } if ( empty ( $ frame [ 'class' ] ) ) { $ callfunc = $ frame [ 'function' ] ; } else { $ callfunc = array ( $ frame [ 'class' ] , $ frame [ 'function' ] ) ; } $ calls = CallFinder :: getFunctionCalls ( \ file_get_contents ( $ frame [ 'file' ] ) , $ frame [ 'line' ] , $ callfunc ) ; $ return = null ; foreach ( $ calls as $ call ) { $ is_unpack = false ; // Handle argument unpacking as a last resort if ( KINT_PHP56 ) { foreach ( $ call [ 'parameters' ] as $ i => & $ param ) { if ( 0 === \ strpos ( $ param [ 'name' ] , '...' ) ) { if ( $ i < $ argc && $ i === \ count ( $ call [ 'parameters' ] ) - 1 ) { for ( $ j = 1 ; $ j + $ i < $ argc ; ++ $ j ) { $ call [ 'parameters' ] [ ] = array ( 'name' => 'array_values(' . \ substr ( $ param [ 'name' ] , 3 ) . ')[' . $ j . ']' , 'path' => 'array_values(' . \ substr ( $ param [ 'path' ] , 3 ) . ')[' . $ j . ']' , 'expression' => false , ) ; } $ param [ 'name' ] = 'reset(' . \ substr ( $ param [ 'name' ] , 3 ) . ')' ; $ param [ 'path' ] = 'reset(' . \ substr ( $ param [ 'path' ] , 3 ) . ')' ; $ param [ 'expression' ] = false ; } else { $ call [ 'parameters' ] = \ array_slice ( $ call [ 'parameters' ] , 0 , $ i ) ; } $ is_unpack = true ; break ; } if ( $ i >= $ argc ) { continue 2 ; } } } if ( $ is_unpack || \ count ( $ call [ 'parameters' ] ) === $ argc ) { if ( null === $ return ) { $ return = $ call ; } else { // If we have multiple calls on the same line with the same amount of arguments, // we can't be sure which it is so just return null and let them figure it out return null ; } } } return $ return ; }
Returns specific function call info from a stack trace frame, or null if no match could be found.

@param array $frame The stack trace frame in question
@param int   $argc  The amount of arguments received

@return null|array{parameters:array, modifiers:array} params and modifiers, or null if a specific call could not be determined
Returns specific function call info from a stack trace frame or null if no match could be found .