Check if this message is compatible with passed call array.

@param  array   $call     A call array.
@param  boolean $withArgs Boolean indicating if matching should take arguments into account.
@return boolean
420597
public function match($call, $withArgs = true)
    {
        if (preg_match('/^::.*/', $call['name'])) {
            $call['static'] = true;
            $call['name'] = substr($call['name'], 2);
        }

        if (isset($call['static'])) {
            if ($call['static'] !== $this->_static) {
                return false;
            }
        }

        if ($call['name'] !== $this->_name) {
            return false;
        }

        if ($withArgs) {
            return $this->matchArgs($call['args']);
        }

        return true;
    }
919333
public static function call(callable $callable, $args=[])
    {
        if (!is_array($args)) {
            $args = [$args];
        }

        switch (count($args)) {
            case 0:
                return call_user_func($callable);
            case 1:
                return call_user_func($callable, $args[0]);
            case 2:
                return call_user_func($callable, $args[0], $args[1]);
            case 3:
                return call_user_func($callable, $args[0], $args[1], $args[2]);
            case 4:
                return call_user_func($callable, $args[0], $args[1], $args[2], $args[3]);
        }

        return call_user_func_array($callable, $args);
    }
779791
function checkMapForCurrentServerParams($filename, $multicall = false)
    {
        if (!is_string($filename)) {
            throw new InvalidArgumentException('filename = ' . print_r($filename, true));
        }
        $filename = $this->secureUtf8($filename);

        return $this->execute(ucfirst(__FUNCTION__), array($filename), $multicall);
    }
1326250
public static function withCallsite($s)
    {
        $bt = debug_backtrace();

        $caller = null;
        do {
            $caller = array_shift($bt);

        } while ($caller && !empty($caller['class']) && $caller['class'] == 'DebugHelper\Logger');

        $file = isset($caller['file']) ? basename($caller['file']) : 'null';
        $line = isset($caller['line']) ? $caller['line'] : 'null';

        return '['.$file.':'.$line.'] '.$s;
    }
427554
function calledWith() {
  var calledWithCount = 0;
  var args = [];
  var argsLength = arguments.length;
  for (var i = 0; i < argsLength; i++) {
    args[i] = arguments[i];
  }
  var callsLength = this._calls.length;
  CALLS: for (var i = 0; i < callsLength; i++) {
    var match = false;
    var called = this._calls[i];
    var calledLength = called.length;
    if (argsLength === 0 && calledLength === 0) {
      match = true;
    } else {
      ARGS: for (var a = 0; a < argsLength; a++) {
        match = matchArgs(args[a],called[a]);
        if (!match) {
          break ARGS;
        }
      }
    }
    if (match) {
      calledWithCount++;
    }
  }
  return calledWithCount;
}
400759
private function betweenFilter($call, $arguments)
    {
        $num = $this->unsafeFilter($call, $arguments);

        return max(min($arguments[2], $num), $arguments[1]);
    }
366470
function sendToServerAfterMatchEnd($link, $multicall = false)
    {
        if (!is_string($link)) {
            throw new InvalidArgumentException('link = ' . print_r($link, true));
        }

        $link = str_replace("maniaplanet://", "", $link);

        return $this->execute(ucfirst(__FUNCTION__), array($link), $multicall);
    }
662743
public static function call(callable $callable, $args=null)
    {

        if (!is_array($args)) {
            $args = $args === null ? [] : [$args];
        }

        return static::callFast($callable, static::evaluateArgs($args));

    }
854838
public function api($sProvider, $call = '')
    {
        if (!$this->isConnectedWith($sProvider)) {
            $this->setError('Not connected with provider "' . $sProvider . '"');
            return false;
        }

        try {

            $sProvider = $this->getProviderClass($sProvider);
            $oProvider = $this->oHybridAuth->getAdapter($sProvider);
            return $oProvider->api()->api($call);

        } catch (\Exception $e) {
            $this->setError('Provider Error: ' . $e->getMessage());
            return false;
        }
    }
927745
protected function executeCallable($callable, array $arguments = [])
    {
        // resolve a pseudo callable to real callable
        $call = $this->resolvePseudoCallable($callable);

        // execute the callable
        return call_user_func_array(
            $call,
            $this->resolveCallableArguments($call, $arguments)
        );
    }
425778
public function processCall(Session $session, Call $call)
    {
        // find a registration to call
        if (count($this->registrations) === 0) {
            $session->sendMessage(ErrorMessage::createErrorMessageFromMessage($call->getCallMessage(), 'wamp.error.no_such_procedure'));
            return false;
        }

        // just send it to the first one if we don't allow multiple registrations
        if (!$this->getAllowMultipleRegistrations()) {
            $this->registrations[0]->processCall($call);
        } else {
            $this->callQueue->enqueue($call);
            $this->processQueue();
        }

        return true;
    }
607149
public function matchArgs($args)
    {
        if ($this->_args === null || $args === null) {
            return true;
        }
        $arg = $this->_classes['arg'];
        foreach ($this->_args as $expected) {
            $actual = array_shift($args);
            if ($expected instanceof $arg) {
                if (!$expected->match($actual)) {
                    return false;
                }
            } elseif ($actual !== $expected) {
                return false;
            }
        }
        return true;
    }
99976
protected static function checkArrayFunctionArgumentsMatch(
        StatementsAnalyzer $statements_analyzer,
        array $args,
        $method_id,
        bool $check_functions
    ) {
        $closure_index = $method_id === 'array_map' ? 0 : 1;

        $array_arg_types = [];

        foreach ($args as $i => $arg) {
            if ($i === 0 && $method_id === 'array_map') {
                continue;
            }

            if ($i === 1 && $method_id === 'array_filter') {
                break;
            }

            $array_arg = isset($arg->value) ? $arg->value : null;

            /** @var ObjectLike|TArray|null */
            $array_arg_type = $array_arg
                    && isset($array_arg->inferredType)
                    && isset($array_arg->inferredType->getTypes()['array'])
                ? $array_arg->inferredType->getTypes()['array']
                : null;

            if ($array_arg_type instanceof ObjectLike) {
                $array_arg_type = $array_arg_type->getGenericArrayType();
            }

            $array_arg_types[] = $array_arg_type;
        }

        /** @var null|PhpParser\Node\Arg */
        $closure_arg = isset($args[$closure_index]) ? $args[$closure_index] : null;

        /** @var Type\Union|null */
        $closure_arg_type = $closure_arg && isset($closure_arg->value->inferredType)
                ? $closure_arg->value->inferredType
                : null;

        if ($closure_arg && $closure_arg_type) {
            $min_closure_param_count = $max_closure_param_count = count($array_arg_types);

            if ($method_id === 'array_filter') {
                $max_closure_param_count = count($args) > 2 ? 2 : 1;
            }

            foreach ($closure_arg_type->getTypes() as $closure_type) {
                if (self::checkArrayFunctionClosureType(
                    $statements_analyzer,
                    $method_id,
                    $closure_type,
                    $closure_arg,
                    $min_closure_param_count,
                    $max_closure_param_count,
                    $array_arg_types,
                    $check_functions
                ) === false) {
                    return false;
                }
            }
        }
    }
758357
private function _wrapArgs($caller_args, $num_args=null) {
    $num_args = (is_null($num_args)) ? count($caller_args) - 1 : $num_args;
    
    $filled_args = array();
    if(isset($this) && isset($this->_wrapped)) {
      $filled_args[] =& $this->_wrapped;
    }
    if(count($caller_args) > 0) {
      foreach($caller_args as $k=>$v) {
        $filled_args[] = $v;
      }
    }
    
    return array_pad($filled_args, $num_args, null);
  }
511413
protected function areArgumentsValid($args, array $accepted)
    {
        if ($args == null)
        {
            return;
        }

        foreach ($accepted as $accept)
        {
            if (array_key_exists($accept, $args))
            {
                return true;
            }
        }

        throw new \InvalidArgumentException('This call only accepts these arguments: ' . implode(" | ",$accepted));
    }
929117
protected function checkCallable()
    {
        $callback = $this->getConfig('callback');

        if (!is_callable($callback)) {
            throw new InvalidArgumentException(sprintf(
                'The `callback` option is not a callable. Got `%s` instead.',
                gettype($callback)
            ));
        }
    }
40117
public static function with(callable $callable, int $options = 0)
    {
        $enabled = self::hasXdebug();
        $inherited = self::isEnabled();

        if ($enabled && !$inherited) {
            xdebug_start_code_coverage($options);
        }

        $result = $callable();

        if ($enabled && !$inherited) {
            xdebug_stop_code_coverage(false);
        }

        return $result;
    }