<?php
declare(strict_types=1);
namespace Symfony\Component\HttpFoundation;
class Cookie
{
public const SAMESITE_LAX = 'lax';
public function __construct(
string $name,
?string $value = null,
int $expire = 0,
?string $path = '/',
?string $domain = null,
?bool $secure = null,
bool $httpOnly = true,
bool $raw = false,
?string $sameSite = null,
) {
}
}
namespace App;
use Symfony\Component\HttpFoundation\Cookie;
final class SomeService
{
public function alreadyMigrated(string $domain): Cookie
{
- return new Cookie('name', 'value', 0, domain: $domain, secure: false, sameSite: Cookie::SAMESITE_LAX);
+ return new Cookie('name', 'value', 0, domain: $domain, secure: null, sameSite: \Symfony\Component\HttpFoundation\Cookie::SAMESITE_LAX);
}
public function intentionallyInsecure(string $domain): Cookie
{
- return new Cookie('name', 'value', 0, '/', $domain, false, false);
+ return new Cookie('name', 'value', 0, '/', $domain, null, false);
}
}