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

Breadcrumb

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

function ResponseCookieValueSame::getCookie

1 call to ResponseCookieValueSame::getCookie()
ResponseCookieValueSame::matches in vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php

File

vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php, line 62

Class

ResponseCookieValueSame

Namespace

Symfony\Component\HttpFoundation\Test\Constraint

Code

protected function getCookie(Response $response) : ?Cookie {
    $cookies = $response->headers
        ->getCookies();
    $filteredCookies = array_filter($cookies, fn(Cookie $cookie) => $cookie->getName() === $this->name && $cookie->getPath() === $this->path && $cookie->getDomain() === $this->domain);
    return reset($filteredCookies) ?: null;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal