Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
45 | public static function fromString(string $sameSite) : self |
||
46 | { |
||
47 | $lowerCaseSite = strtolower($sameSite); |
||
48 | |||
49 | if ($lowerCaseSite === 'strict') { |
||
50 | return self::strict(); |
||
51 | } |
||
52 | |||
53 | if ($lowerCaseSite === 'lax') { |
||
54 | return self::lax(); |
||
55 | } |
||
56 | |||
57 | if ($lowerCaseSite === 'none') { |
||
58 | return self::none(); |
||
59 | } |
||
60 | |||
61 | throw new \InvalidArgumentException(sprintf( |
||
62 | 'Expected modifier value to be either "strict", "lax", or "none", "%s" given', |
||
63 | $sameSite |
||
64 | )); |
||
65 | } |
||
66 | |||
72 |