Kahlan\Plugin\Call\Calls::_matchReference PHP Method

_matchReference() protected static method

Helper for the _findAll() method.
protected static _matchReference ( object | string $reference, array $logs = [] ) : array
$reference object | string An instance or a fully-namespaced class name.
$logs array The logged calls.
return array The founded log call.
    protected static function _matchReference($reference, $logs = [])
    {
        foreach ($logs as $log) {
            if (!$reference) {
                if (empty($log['class']) && empty($log['instance'])) {
                    return $log;
                }
            } elseif (is_object($reference)) {
                if ($reference === $log['instance']) {
                    return $log;
                }
            } elseif ($reference === $log['class']) {
                return $log;
            }
        }
    }