$str.='Expires='.\gmdate('D, d M Y H:i:s \G\M\T',$v).'; ';
}else{
$str.=($v===true?$k:"{$k}={$v}").'; ';
}
}
}
return\rtrim($str,'; ');
}
publicfunctiontoArray():array
{
return$this->data;
}
/**
* Get the cookie name.
*
* @return string
*/
publicfunctiongetName()
{
return$this->data['Name'];
}
/**
* Set the cookie name.
*
* @param string $name Cookie name
*/
publicfunctionsetName($name):void
{
if(!is_string($name)){
trigger_deprecation('guzzlehttp/guzzle','7.4','Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.',__CLASS__,__FUNCTION__);
}
$this->data['Name']=(string)$name;
}
/**
* Get the cookie value.
*
* @return string|null
*/
publicfunctiongetValue()
{
return$this->data['Value'];
}
/**
* Set the cookie value.
*
* @param string $value Cookie value
*/
publicfunctionsetValue($value):void
{
if(!is_string($value)){
trigger_deprecation('guzzlehttp/guzzle','7.4','Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.',__CLASS__,__FUNCTION__);
}
$this->data['Value']=(string)$value;
}
/**
* Get the domain.
*
* @return string|null
*/
publicfunctiongetDomain()
{
return$this->data['Domain'];
}
/**
* Set the domain of the cookie.
*
* @param string|null $domain
*/
publicfunctionsetDomain($domain):void
{
if(!is_string($domain)&&null!==$domain){
trigger_deprecation('guzzlehttp/guzzle','7.4','Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.',__CLASS__,__FUNCTION__);
trigger_deprecation('guzzlehttp/guzzle','7.4','Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.',__CLASS__,__FUNCTION__);
* @param int|null $maxAge Max age of the cookie in seconds
*/
publicfunctionsetMaxAge($maxAge):void
{
if(!is_int($maxAge)&&null!==$maxAge){
trigger_deprecation('guzzlehttp/guzzle','7.4','Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.',__CLASS__,__FUNCTION__);
trigger_deprecation('guzzlehttp/guzzle','7.4','Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.',__CLASS__,__FUNCTION__);