Simplify Cookie::send()

This commit is contained in:
Giuseppe Criscione 2020-11-26 16:39:37 +01:00
parent 235f145f98
commit 026cce18b2

View File

@ -29,7 +29,7 @@ class Cookie
public static function send(string $name, string $value, array $options = [], bool $replace = false): void
{
$options = array_merge(static::defaults(), (array) $options);
if (in_array(strtolower($name), array_keys($options), true)) {
if (array_key_exists(strtolower($name), $options)) {
throw new InvalidArgumentException('Invalid cookie name "' . $name . '"');
}
$data = [$name => rawurlencode($value)] + static::parseOptions($options);