Wrap the supplied calls in verifiers.

@param array<Call> $calls The calls.

@return array<CallVerifier> The call verifiers.
559034
public function fromCalls(array $calls): array
    {
        $verifiers = [];

        foreach ($calls as $call) {
            $verifiers[] = new CallVerifier(
            $call,
                $this->matcherFactory,
                $this->matcherVerifier,
                $this->generatorVerifierFactory,
                $this->iterableVerifierFactory,
                $this->assertionRecorder,
                $this->assertionRenderer
            );
        }

        return $verifiers;
    }
765771
protected function getCalls() {
        if (!$this->_calls) {
            $this->_calls = new CallList($this->version, $this->solution['sid']);
        }

        return $this->_calls;
    }
175720
def with_fakes(method):
    
    @wraps(method)
    def apply_clear_and_verify(*args, **kw):
        clear_calls()
        method(*args, **kw)
        verify() # if no exceptions
    return apply_clear_and_verify
935488
protected static function getBranchesPassthrough(array $branches)
	{
		$values = [];
		foreach ($branches as $branch)
		{
			$values[] = $branch['passthrough'];
		}

		// If the last branch isn't an "else", we act as if there was an additional branch with no
		// passthrough
		if ($branch['statement'] !== 'else')
		{
			$values[] = 0;
		}

		return array_unique($values);
	}
701665
public function telephonyCallsUpload(array $calls)
    {
        if (!count($calls)) {
            throw new \InvalidArgumentException(
                'Parameter `calls` must contains array of the calls'
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            '/telephony/calls/upload',
            "POST",
            ['calls' => json_encode($calls)]
        );
    }
1321036
private function getContainer(Call $call)
    {
        if (!$call instanceof EnvironmentCall) {
            throw new UnsupportedCallException(sprintf(
                'ServicesResolver can not filter `%s` call.',
                get_class($call)
            ), $call);
        }

        $environment = $call->getEnvironment();

        if (!$environment instanceof ServiceContainerEnvironment) {
            throw new UnsupportedCallException(sprintf(
                'ServicesResolver can not filter `%s` call.',
                get_class($call)
            ), $call);
        }

        return $environment->getServiceContainer();
    }
114481
public function using($pattern, $call = null)
    {
        if ($call == null && ($pattern instanceof Middleware)) {
            return $this->preUse($pattern);
        }
        return $this->invoke($pattern, $call);
    }
823735
public function invokeWith($arguments = [])
    {
        $this->closeRule();

        if (empty($this->rules)) {
            $defaultAnswerCallback = $this->defaultAnswerCallback;
            $defaultAnswerCallback($this);
            $this->closeRule();
        }

        if ($arguments instanceof Arguments) {
            $argumentsArray = $arguments->all();
        } else {
            $argumentsArray = $arguments;
            $arguments = new Arguments($arguments);
        }

        foreach ($this->rules as $rule) {
            if (
                $this->matcherVerifier
                    ->matches($rule->criteria(), $argumentsArray)
            ) {
                break;
            }
        }

        $answer = $rule->next();

        foreach ($answer->secondaryRequests() as $request) {
            $this->invoker->callWith(
                $request->callback(),
                $request->finalArguments($this->self, $arguments)
            );
        }

        $request = $answer->primaryRequest();

        return $this->invoker->callWith(
            $request->callback(),
            $request->finalArguments($this->self, $arguments)
        );
    }
461835
public Descriptor withCalls(Call<?, ?>... calls) {
        return replaceAllCalls(this.calls.plusAll(Arrays.asList(calls)));
    }
188748
public function setAllowMethods($methods)
    {
        $methods = (array) $methods;

        $methods = array_map('strtoupper', $methods);

        $this->allowMethods = $methods;

        return $this;
    }
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];
    }
156200
private function registerInvocations(array $invocations)
    {
        foreach ($invocations as $invocation) {
            if ($invocation->getArgument(0)->getType() != ReflectionArgument::STRING) {
                //We can only index invocations with constant string arguments
                continue;
            }

            $string = $invocation->getArgument(0)->stringValue();
            $string = $this->prepareMessage($string);

            $this->registerMessage($this->invocationDomain($invocation), $string, false);
        }
    }
997770
private function repackageCallIfNewArguments(Call $call, array $arguments)
    {
        if ($arguments === $call->getArguments()) {
            return $call;
        }

        return $this->repackageCallWithNewArguments($call, $arguments);
    }
757441
private function mockAbusedClient(array $functions): AbusedClient
    {
        return new class($functions) extends AbusedClient {
            /** @var array */
            private $functions;

            public function __construct(array $functions)
            {
                $this->functions = $functions;
            }

            public function __getFunctions()
            {
                return $this->functions;
            }
        };
    }
34355
public function cacheKey($caller, array $parameters = [])
    {
        $parameters = compact('caller', 'parameters');

        if ($this->repository->model instanceof Eloquent || $this->repository->model instanceof Builder) {
            $parameters['eager'] = md5(serialize($this->repository->with));
        }

        if ($this->repository->mediator->criteria()->hasCriteria()) {
            $parameters['criteria'] = md5(serialize($this->repository->mediator->criteria()->getCriterias()));
        }

        return md5(serialize($parameters));
    }
645054
public function setCallbacks(array $callables)
    {
        $this->callbacks = [];

        foreach ($callables as $callable) {
            if (is_callable($callable)) {
                $this->addCallback($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;
    }