v1.1.4
This commit is contained in:
parent
d6e6011c3d
commit
1dd5809016
1 changed files with 21760 additions and 3778 deletions
|
|
@ -175,7 +175,7 @@ class SetCookie
|
|||
public function setName($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__);
|
||||
\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;
|
||||
|
|
@ -199,7 +199,7 @@ class SetCookie
|
|||
public function setValue($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__);
|
||||
\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;
|
||||
|
|
@ -223,7 +223,7 @@ class SetCookie
|
|||
public function setDomain($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 or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
|
||||
}
|
||||
|
||||
$this->data['Domain'] = null === $domain ? null : (string) $domain;
|
||||
|
|
@ -247,7 +247,7 @@ class SetCookie
|
|||
public function setPath($path): void
|
||||
{
|
||||
if (!is_string($path)) {
|
||||
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__);
|
||||
\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['Path'] = (string) $path;
|
||||
|
|
@ -271,7 +271,7 @@ class SetCookie
|
|||
public function setMaxAge($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 or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
|
||||
}
|
||||
|
||||
$this->data['Max-Age'] = $maxAge === null ? null : (int) $maxAge;
|
||||
|
|
@ -295,10 +295,18 @@ class SetCookie
|
|||
public function setExpires($timestamp): void
|
||||
{
|
||||
if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) {
|
||||
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__);
|
||||
\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__);
|
||||
}
|
||||
|
||||
$this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp));
|
||||
if (null === $timestamp) {
|
||||
$this->data['Expires'] = null;
|
||||
} elseif (\is_numeric($timestamp)) {
|
||||
$this->data['Expires'] = (int) $timestamp;
|
||||
} else {
|
||||
// Store unparseable dates as session cookies, not as expired cookies.
|
||||
$expires = \strtotime((string) $timestamp);
|
||||
$this->data['Expires'] = $expires === false ? null : $expires;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -319,7 +327,7 @@ class SetCookie
|
|||
public function setSecure($secure): void
|
||||
{
|
||||
if (!is_bool($secure)) {
|
||||
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
|
||||
\trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
|
||||
}
|
||||
|
||||
$this->data['Secure'] = (bool) $secure;
|
||||
|
|
@ -343,7 +351,7 @@ class SetCookie
|
|||
public function setDiscard($discard): void
|
||||
{
|
||||
if (!is_bool($discard)) {
|
||||
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
|
||||
\trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
|
||||
}
|
||||
|
||||
$this->data['Discard'] = (bool) $discard;
|
||||
|
|
@ -367,7 +375,7 @@ class SetCookie
|
|||
public function setHttpOnly($httpOnly): void
|
||||
{
|
||||
if (!is_bool($httpOnly)) {
|
||||
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
|
||||
\trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
|
||||
}
|
||||
|
||||
$this->data['HttpOnly'] = (bool) $httpOnly;
|
||||
|
|
@ -480,10 +488,10 @@ class SetCookie
|
|||
return 'The cookie value must not be empty';
|
||||
}
|
||||
|
||||
// Domains must not be empty, but can be 0. "0" is not a valid internet
|
||||
// domain, but may be used as server name in a private network.
|
||||
// Domains must not be empty, but may be omitted. "0" is not a valid
|
||||
// internet domain, but may be used as server name in a private network.
|
||||
$domain = $this->getDomain();
|
||||
if ($domain === null || $domain === '') {
|
||||
if ($domain === '') {
|
||||
return 'The cookie domain must not be empty';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue