Wrap the supplied call in a verifier.

@param Call $call The call.

@return CallVerifier The call verifier.
338530
public function fromCall(Call $call): CallVerifier
    {
        return new CallVerifier(
            $call,
            $this->matcherFactory,
            $this->matcherVerifier,
            $this->generatorVerifierFactory,
            $this->iterableVerifierFactory,
            $this->assertionRecorder,
            $this->assertionRenderer
        );
    }
83848
private function updateCall(DICallWrapper $call)
    {
        $callsCount = count($this->serviceArray[$this::CALLS_SECTION]);

        for ($i = 0; $i < $callsCount; $i++) {
            $existingCall = new DICallWrapper($this->serviceArray[$this::CALLS_SECTION][$i]);
            if ($existingCall->getMethodName() === $call->getMethodName()) {
                $this->serviceArray[$this::CALLS_SECTION][$i] = $call->getCallAsArray();
                return;
            }
        }
        throw new MissingUpdateCallException();
    }
1006490
function setIssuerException(/*callable*/ $callable)
    {
        if (!is_callable($callable))
            throw new \InvalidArgumentException(sprintf(
                'Issuer must be callable; given: (%s).'
                , \Poirot\Std\flatten($callable)
            ));
        
        $this->issuer_exception = $callable;
        return $this;
    }
251825
public function createFromCallback($callback): StubVerifier
    {
        $stub = $this->stubFactory->create($callback);

        $verifier = new StubVerifier(
            $stub,
            $this->spyFactory->create($stub),
            $this->matcherFactory,
            $this->matcherVerifier,
            $this->generatorVerifierFactory,
            $this->iterableVerifierFactory,
            $this->callVerifierFactory,
            $this->assertionRecorder,
            $this->assertionRenderer,
            $this->generatorAnswerBuilderFactory
        );
        $verifier->setSelf($verifier);

        return $verifier;
    }
942734
public function setCallbackWrapper(?callable $callbackWrapper): callable
    {
        $previousWrapper = $this->callbackWrapper;
        $this->callbackWrapper = $callbackWrapper ?? function (callable $callback, ItemInterface $item, bool &$save, CacheInterface $pool, \Closure $setMetadata, ?LoggerInterface $logger) {
            return $callback($item, $save);
        };

        return $previousWrapper;
    }
453765
public function removeCall(Call $call)
    {
        $newQueue = new \SplQueue();
        while (!$this->callQueue->isEmpty()) {
            $c = $this->callQueue->dequeue();

            if ($c === $call)
                continue;

            $newQueue->enqueue($c);
        }
        $this->callQueue = $newQueue;

        $registration = $call->getRegistration();
        if ($registration) {
            $registration->removeCall($call);
        }
    }
1224003
public function setCaller($caller = null)
    {
        $this->caller = (null !== $caller) ? (string)$caller : null;

        return $this;
    }
419145
public function processCall(Call $call)
    {
        if ($call->getRegistration() !== null) {
            throw new \Exception('Registration already set when asked to process call');
        }
        $call->setRegistration($this);

        $this->calls[] = $call;

        $this->session->incPendingCallCount();
        $callCount = count($this->calls);
        if ($callCount === 1) {
            // we just became busy
            $this->busyStart = microtime(true);
        }
        if ($callCount > $this->maxSimultaneousCalls) {
            $this->maxSimultaneousCalls = $callCount;
        }
        $this->invocationCount++;
        $this->lastCallStartedAt = new \DateTime();

        $this->getSession()->sendMessage($call->getInvocationMessage());
    }
1107644
public static function executeCallableRoute(callable $call, $route = '')
    {
        call_user_func($call);
        Cml::$debug && Debug::addTipInfo(Lang::get('_CML_EXECUTION_ROUTE_IS_', "callable route:{{$route}}", Config::get('url_model')));
        Cml::cmlStop();
    }
206916
protected function resolveCallable($callable)
    {
        if (!$this->container instanceof ContainerInterface) {
            return $callable;
        }

        /** @var CallableResolverInterface $resolver */
        $resolver = $this->container->get('callableResolver');

        return $resolver->resolve($callable);
    }
607886
private function preUse(Middleware $call)
    {
        $class = get_class($call);
        if (in_array($class, $this->preMiddlewareArr)) {
            throw new Exception($class . ' Pre-Middleware has loaded');
        }
        $this->preMiddlewareArr[] = $class;
        if ($this->preMiddleware) {
            $call->nextMiddleware($this->preMiddleware);
        }
        $call->setVitex($this);
        $this->preMiddleware = $call;
        return $this;
    }
1064863
private function processCall(\stdClass $call)
    {
        $id = property_exists($call, 'id') ? $call->id : null;
        $params = property_exists($call, 'params') ? $call->params : [];
        $result = null;
        $namespace = substr($call->method, 0, strpos($call->method, '.'));

        try {
            // set named parameters
            if (is_object($params)) {
                $newParams = [];
                foreach ($this->reflectionMethods[$call->method]->getParameters() as $param) {
                    $paramName = $param->getName();
                    $defaultValue = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;
                    $newParams[] = property_exists($params, $paramName) ? $params->$paramName : $defaultValue;
                }

                $params = $newParams;
            }

            // invoke
            $result = $this->reflectionMethods[$call->method]->invokeArgs($this->instances[$namespace], $params);
        } catch (\Exception $e) {
            return $this->getError($e->getCode(), $id, $e->getMessage());
        }

        if (!$id && $id !== 0) {
            return null;
        }

        return [
            'jsonrpc' => '2.0',
            'result' => $result,
            'id' => $id,
        ];
    }
1120854
static function makeReflectFromCallable(callable $callable)
    {
        if ( $callable instanceof ipInvokableCallback )
            $callable = $callable->getCallable();

        if ( is_array($callable) )
            // [className_orObject, 'method_name']
            $reflection = new \ReflectionMethod($callable[0], $callable[1]);

        if ( is_string($callable) ) {
            if ( strpos($callable, '::') )
                // 'classname::method'
                $reflection = new \ReflectionMethod($callable);
            else
                // 'function_name'
                $reflection = new \ReflectionFunction($callable);
        }

        if ( method_exists($callable, '__invoke') ) {
            // Closure and Invokable
            if ($callable instanceof \Closure)
                $reflection = new \ReflectionFunction($callable);
            else
                $reflection = new \ReflectionMethod($callable, '__invoke');
        }

        if (! isset($reflection) )
            throw new \ReflectionException;

        return $reflection;
    }
378448
public static function stub(callable $callback = null): StubVerifier
    {
        $container = self::$globals::$container;

        return $container->stubVerifierFactory->createFromCallback($callback);
    }
738630
private function initializeFromSingle($call)
    {
        $this->action = $call['action'];
        $this->method = $call['method'];
        $this->type   = $call['type'];
        $this->tid    = $call['tid'];
        $this->data   = (array)$call['data'][0];
    }
376922
protected function getCallbackFromReference($reference): callable
    {
        $this->reference = $reference;
        if(is_callable($reference)) {
            if(!is_string($reference)) {
                $callback = $reference;
            } else {
                $parts = explode("::", $reference);
                $callback = [new $parts[0](), $parts[1]];
            }
        } else {
            $callback = function () use ($reference) {
                new RegularResponse($reference);
            };
        }

        return $callback;
    }
279045
protected function buildResolvingCallable($originalCallable)
    {
        $originalCallable = $this->checkAndReturnCallable($originalCallable);

        return function ($resolved, $laravel) use ($originalCallable) {
            call_user_func($originalCallable, $resolved, $this);
        };
    }