@param array $ulimits

@return Client
326848
public function setUlimits(array $ulimits)
    {
        $this->ulimits = $ulimits;

        $this->hostConfig = array_merge($this->hostConfig, ['Ulimits' => $ulimits]);

        return $this;
    }
498401
public function withHeaders(array $headers)
    {
        $clone = clone $this;

        foreach ($headers as $name => $value) {
            $clone->headers->set($name, $value);
        }

        return $clone;
    }
325404
public function setClientUris(array $clientUris = null)
    {
        ValidationUtility::ensureNullOrArrayOfType(
            '$clientUris', $clientUris, __NAMESPACE__ . '\TaggedValue');

        $this->clientUris = $clientUris;

        return $this;
    }
191413
public static function simpleClient($url, $options = null, $transport = null) 
	{
		$options['version'] = 'simple';
		return self::client($url, $options, $transport);
	}
141874
public static function initialize($url, $token = null, $options = [], $normalizers = [])
    {
        //strap guzzle client if it is not set in as resolver property
        if (!isset(static::$clientResolver)) {
            static::setClientResolver(function ($options) {
                $clientOptions = isset($options['client']) ? $options['client'] : [];
                return new Client($clientOptions);
            });
        }

        return new static(array_merge($options, ['base_url' => $url, 'token' => $token]), null, $normalizers);
    }
1026142
private function withClientSecret(array $params)
    {
        $message = $params['scope'].$params['timestamp'].$params['client_id'].$params['state'];
        $signature = $this->signer->sign($message);
        $params['client_secret'] = $this->encoder->base64UrlEncode($signature);

        return $params;
    }
923256
public static function createFromArray(array $params)
    {
        return new static(
            isset($params['method']) ? $params['method'] : 'GET',
            new Uri(isset($params['uri']) ? $params['uri'] : ''),
            isset($params['headers']) ? $params['headers'] : array(),
            isset($params['body']) ? (is_resource($params['body']) ? new Stream($params['body']) : Stream::createFromContents($params['body'])) : Stream::createFromContents(''),
            isset($params['server']) ? $params['server'] : array(),
            isset($params['cookies']) ? $params['cookies'] : array()
        );
    }
968533
public function clients()
    {
        if (is_null($this->clientRequests)) {
            $this->clientRequests = new ClientRequests($this->client);
        }

        return $this->clientRequests;
    }
1342903
public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.xml');

        $httpClient = $config['http_client'];
        $httpClientOptions = $config['http_client_options'];
        $clientConfigurations = $config['clients'];

        $clientServiceKeys = [];
        foreach ($clientConfigurations as $key => $clientConfig) {
            // manually make sure "type" is there
            if (!isset($clientConfig['type'])) {
                throw new InvalidConfigurationException(sprintf(
                    'Your "knpu_oauth2_client.clients.%s" config entry is missing the "type" key.',
                    $key
                ));
            }

            $type = $clientConfig['type'];
            unset($clientConfig['type']);
            if (!isset(self::$supportedProviderTypes[$type])) {
                throw new InvalidConfigurationException(sprintf(
                    'The "knpu_oauth2_client.clients" config "type" key "%s" is not supported. We support (%s)',
                    $type,
                    implode(', ', self::$supportedProviderTypes)
                ));
            }

            // process the configuration
            $tree = new TreeBuilder('knpu_oauth2_client/clients/' . $key);
            $node = method_exists($tree, 'getRootNode')
                ? $tree->getRootNode()
                : $tree->root('knpu_oauth2_client/clients/' . $key);

            $this->buildConfigurationForType($node, $type);
            $processor = new Processor();
            $config = $processor->process($tree->buildTree(), [$clientConfig]);

            $configurator = $this->getConfigurator($type);

            $providerOptions = $configurator->getProviderOptions($config);

            $collaborators = [];
            if ($httpClient) {
                $collaborators['httpClient'] = new Reference($httpClient);
            } else {
                $providerOptions = array_merge($providerOptions, $httpClientOptions);
            }
            // hey, we should add the provider/client service!
            $clientServiceKey = $this->configureProviderAndClient(
                $container,
                $type,
                $key,
                $configurator->getProviderClass($config),
                $configurator->getClientClass($config),
                $configurator->getPackagistName(),
                $providerOptions,
                $config['redirect_route'],
                $config['redirect_params'],
                $config['use_state'],
                $collaborators
            );

            $clientServiceKeys[$key] = $clientServiceKey;
        }

        $container->getDefinition('knpu.oauth2.registry')
            ->replaceArgument(1, $clientServiceKeys);
    }
1005410
protected function createClient(array $servers)
    {
        $clients = [];
        foreach ($servers as $key => $server) {
            $clients[$key] = new \Redis();
            $clients[$key]->pconnect($server['host'], $server['port'], 0, $key . $server['database']);

            if (!empty($server['password'])) {
                $clients[$key]->auth($server['password']);
            }

            if (!empty($server['database'])) {
                $clients[$key]->select($server['database']);
            }
        }

        return $clients;
    }
160716
public function loadAliases(array $aliases)
    {
        foreach ($aliases as $alias => $path) {
            $this->alias($alias, $path);
        }

        return $this;
    }
173350
public function limit($iLimit, $iOffset = null)
	{
		$this->_iLimit = $iLimit;
		$this->_iOffset = $iOffset;
		return $this;
	}
1000944
public static function client(array $config = []): RedisInterface
    {
        $driver = $config['driver'] ?? '';

        if ($driver === 'native' || !PHP_REDIS_EXTENSION) {
            return new Client\Native($config);
        }

        return new Client\PhpRedis($config);
    }
138072
private function createDefaultClient(array $params)
    {
        $stack = HandlerStack::create();

        if (isset($params['cache']) && $params['cache'] === true) {
            $cache = new CacheMiddleware($this->getCacheStrategy());

            $stack->push($cache, 'snorlax-cache');
        }

        if (isset($params['log']) && $params['log'] === true) {
            $logger = new Logger($this->getLogger());
            $logger->setLogLevel(LogLevel::DEBUG);
            $logger->setRequestLoggingEnabled();
            $logger->setFormatter(new MessageFormatter(
                'REQ "{method} {target} HTTP/{version}"',
                'RES "{method} {target} HTTP/{version}" {code}'
            ));

            $stack->push($logger, 'snorlax-logger');
        }

        $params = array_merge($params, ['handler' => $stack]);

        return new Client($params);
    }
37498
public function createClient(array $config = []): HttpClient
    {
        if (!class_exists(Client::class)) {
            throw new LogicException(
                'To use the Socket client you need to install the "php-http/socket-client" package.'
            );
        }

        return new Client($this->messageFactory, $config);
    }
95818
public function update(array $inputs)
    {
        $inputs = $this->purifyInputs($inputs);

        return $this->model->update($inputs);
    }
1182217
public function setHeaders($headers)
    {
        if (!empty($this->headers)) {
            $this->headers = array_merge($this->headers, $headers);
        } else {
            $this->headers = $headers;
        }
        $this->headers = array_merge($this->headers, $headers);

        if ($this->client instanceof \swoole_http_client) {
            $this->client->setHeaders($this->headers);
        }
        return $this;
    }