Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
79 | public static function oneFromCookiePair(string $string) : Cookie |
||
80 | { |
||
81 | list ($cookieName, $cookieValue) = StringUtil::splitCookiePair($string); |
||
82 | |||
83 | /** @var Cookie $cookie */ |
||
84 | 23 | $cookie = new static($cookieName); |
|
85 | |||
86 | 23 | if ($cookieValue !== null) { |
|
87 | $cookie = $cookie->withValue($cookieValue); |
||
88 | 23 | } |
|
89 | 20 | ||
90 | 23 | return $cookie; |
|
91 | } |
||
92 | } |
||
93 |