1 | <?php |
||
10 | final class SameSite |
||
11 | { |
||
12 | /** |
||
13 | * The possible string values of the SameSite setting |
||
14 | */ |
||
15 | private const STRICT = 'Strict'; |
||
16 | private const LAX = 'Lax'; |
||
17 | private const NONE = 'None'; |
||
18 | |||
19 | /** @var string */ |
||
20 | private $value; |
||
21 | |||
22 | private function __construct(string $value) |
||
26 | |||
27 | public static function strict() : self |
||
31 | |||
32 | public static function lax() : self |
||
36 | |||
37 | public static function none() : self |
||
41 | |||
42 | /** |
||
43 | * @throws \InvalidArgumentException If the given SameSite string is neither strict nor lax. |
||
44 | */ |
||
45 | public static function fromString(string $sameSite) : self |
||
66 | |||
67 | public function asString() : string |
||
71 | } |
||
72 |