Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HttpClientKernel.php

function HttpClientKernel::__construct

File

vendor/symfony/http-kernel/HttpClientKernel.php, line 36

Class

HttpClientKernel
An implementation of a Symfony HTTP kernel using a "real" HTTP client.

Namespace

Symfony\Component\HttpKernel

Code

public function __construct(?HttpClientInterface $client = null) {
    if (null === $client && !class_exists(HttpClient::class)) {
        throw new \LogicException(\sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__));
    }
    $this->client = $client ?? HttpClient::create();
}
RSS feed
Powered by Drupal