Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public static function fromString(string $sameSite) : self |
||
34 | { |
||
35 | $lowerCaseSite = strtolower($sameSite); |
||
36 | |||
37 | if ($lowerCaseSite === 'strict') { |
||
38 | return self::strict(); |
||
39 | } |
||
40 | |||
41 | if ($lowerCaseSite === 'lax') { |
||
42 | return self::lax(); |
||
43 | } |
||
44 | |||
45 | throw new \InvalidArgumentException(sprintf( |
||
46 | 'Expected modifier value to be either "strict" or "lax", "%s" given', |
||
47 | $sameSite |
||
48 | )); |
||
49 | } |
||
50 | |||
56 |