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

Breadcrumb

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

function HttpBrowser::__construct

Overrides AbstractBrowser::__construct

File

vendor/symfony/browser-kit/HttpBrowser.php, line 34

Class

HttpBrowser
An implementation of a browser using the HttpClient component to make real HTTP requests.

Namespace

Symfony\Component\BrowserKit

Code

public function __construct(?HttpClientInterface $client = null, ?History $history = null, ?CookieJar $cookieJar = null) {
    if (!$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();
    parent::__construct([], $history, $cookieJar);
}
RSS feed
Powered by Drupal