public static function fromHeader(string $string) : Cookie { $parts = array_map('trim', explode('=', $string, 2)); if (2 !== count($parts)) { throw new InvalidValueException('Invalid cookie header format.'); } list($name, $value) = $parts; return new self($name, $value); }