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
Namespace
Symfony\Component\HttpFoundation\Test\ConstraintCode
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;
}