public static function getCallInfo(array $aliases, array $trace, $argc)
    {
        $found = false;
        $callee = null;
        $caller = null;
        $miniTrace = array();

        foreach ($trace as $index => $frame) {
            if (Utils::traceFrameIsListed($frame, $aliases)) {
                $found = true;
                $miniTrace = array();
            }

            if (!Utils::traceFrameIsListed($frame, array('spl_autoload_call'))) {
                $miniTrace[] = $frame;
            }
        }

        if ($found) {
            $callee = \reset($miniTrace) ?: null;

            /** @var null|array Psalm bug workaround */
            $caller = \next($miniTrace) ?: null;
        }

        foreach ($miniTrace as $index => $frame) {
            if ((0 === $index && $callee === $frame) || isset($frame['file'], $frame['line'])) {
                unset($frame['object'], $frame['args']);
                $miniTrace[$index] = $frame;
            } else {
                unset($miniTrace[$index]);
            }
        }

        $miniTrace = \array_values($miniTrace);

        $call = self::getSingleCall($callee ?: array(), $argc);

        $ret = array(
            'params' => null,
            'modifiers' => array(),
            'callee' => $callee,
            'caller' => $caller,
            'trace' => $miniTrace,
        );

        if ($call) {
            $ret['params'] = $call['parameters'];
            $ret['modifiers'] = $call['modifiers'];
        }

        return $ret;
    }
public static function getCallInfo(array $aliases, array $trace, $argc)
    {
        $found = false;
        $callee = null;
        $caller = null;
        $miniTrace = array();

        foreach ($trace as $index => $frame) {
            if (Utils::traceFrameIsListed($frame, $aliases)) {
                $found = true;
                $miniTrace = array();
            }

            if (!Utils::traceFrameIsListed($frame, array('spl_autoload_call'))) {
                $miniTrace[] = $frame;
            }
        }

        if ($found) {
            $callee = \reset($miniTrace) ?: null;

            /** @var null|array Psalm bug workaround */
            $caller = \next($miniTrace) ?: null;
        }

        foreach ($miniTrace as $index => $frame) {
            if ((0 === $index && $callee === $frame) || isset($frame['file'], $frame['line'])) {
                unset($frame['object'], $frame['args']);
                $miniTrace[$index] = $frame;
            } else {
                unset($miniTrace[$index]);
            }
        }

        $miniTrace = \array_values($miniTrace);

        $call = self::getSingleCall($callee ?: array(), $argc);

        $ret = array(
            'params' => null,
            'modifiers' => array(),
            'callee' => $callee,
            'caller' => $caller,
            'trace' => $miniTrace,
        );

        if ($call) {
            $ret['params'] = $call['parameters'];
            $ret['modifiers'] = $call['modifiers'];
        }

        return $ret;
    }
public static function getCallInfo ( array $ aliases , array $ trace , $ argc ) { $ found = false ; $ callee = null ; $ caller = null ; $ miniTrace = array ( ) ; foreach ( $ trace as $ index => $ frame ) { if ( Utils :: traceFrameIsListed ( $ frame , $ aliases ) ) { $ found = true ; $ miniTrace = array ( ) ; } if ( ! Utils :: traceFrameIsListed ( $ frame , array ( 'spl_autoload_call' ) ) ) { $ miniTrace [ ] = $ frame ; } } if ( $ found ) { $ callee = \ reset ( $ miniTrace ) ? : null ; /** @var null|array Psalm bug workaround */ $ caller = \ next ( $ miniTrace ) ? : null ; } foreach ( $ miniTrace as $ index => $ frame ) { if ( ( 0 === $ index && $ callee === $ frame ) || isset ( $ frame [ 'file' ] , $ frame [ 'line' ] ) ) { unset ( $ frame [ 'object' ] , $ frame [ 'args' ] ) ; $ miniTrace [ $ index ] = $ frame ; } else { unset ( $ miniTrace [ $ index ] ) ; } } $ miniTrace = \ array_values ( $ miniTrace ) ; $ call = self :: getSingleCall ( $ callee ? : array ( ) , $ argc ) ; $ ret = array ( 'params' => null , 'modifiers' => array ( ) , 'callee' => $ callee , 'caller' => $ caller , 'trace' => $ miniTrace , ) ; if ( $ call ) { $ ret [ 'params' ] = $ call [ 'parameters' ] ; $ ret [ 'modifiers' ] = $ call [ 'modifiers' ] ; } return $ ret ; }
Gets call info from the backtrace, alias, and argument count.

Aliases must be normalized beforehand (Utils::normalizeAliases)

@param array   $aliases Call aliases as found in Kint::$aliases
@param array[] $trace   Backtrace
@param int     $argc    Number of arguments

@return array{params:null|array, modifiers:array, callee:null|array, caller:null|array, trace:array[]} Call info
Gets call info from the backtrace alias and argument count .