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