X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fbrowser-kit%2FCookie.php;h=8857b62317b42a03504b324b58f9d85f7f5467dd;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=42f184d532e02615f3dd8aef1194b887c74dfd5e;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/browser-kit/Cookie.php b/vendor/symfony/browser-kit/Cookie.php index 42f184d53..8857b6231 100644 --- a/vendor/symfony/browser-kit/Cookie.php +++ b/vendor/symfony/browser-kit/Cookie.php @@ -21,8 +21,6 @@ class Cookie /** * Handles dates as defined by RFC 2616 section 3.3.1, and also some other * non-standard, but common formats. - * - * @var array */ private static $dateFormats = array( 'D, d M Y H:i:s T', @@ -46,14 +44,14 @@ class Cookie /** * Sets a cookie. * - * @param string $name The cookie name - * @param string $value The value of the cookie - * @param string $expires The time the cookie expires - * @param string $path The path on the server in which the cookie will be available on - * @param string $domain The domain that the cookie is available - * @param bool $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client - * @param bool $httponly The cookie httponly flag - * @param bool $encodedValue Whether the value is encoded or not + * @param string $name The cookie name + * @param string $value The value of the cookie + * @param string|null $expires The time the cookie expires + * @param string|null $path The path on the server in which the cookie will be available on + * @param string $domain The domain that the cookie is available + * @param bool $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client + * @param bool $httponly The cookie httponly flag + * @param bool $encodedValue Whether the value is encoded or not */ public function __construct($name, $value, $expires = null, $path = null, $domain = '', $secure = false, $httponly = true, $encodedValue = false) { @@ -62,7 +60,7 @@ class Cookie $this->rawValue = $value; } else { $this->value = $value; - $this->rawValue = urlencode($value); + $this->rawValue = rawurlencode($value); } $this->name = $name; $this->path = empty($path) ? '/' : $path; @@ -82,10 +80,6 @@ class Cookie /** * Returns the HTTP representation of the Cookie. - * - * @return string The HTTP representation of the Cookie - * - * @throws \UnexpectedValueException */ public function __toString() { @@ -118,8 +112,8 @@ class Cookie /** * Creates a Cookie instance from a Set-Cookie header value. * - * @param string $cookie A Set-Cookie header value - * @param string $url The base URL + * @param string $cookie A Set-Cookie header value + * @param string|null $url The base URL * * @return static * @@ -175,7 +169,7 @@ class Cookie continue; } - if (2 === count($elements = explode('=', $part, 2))) { + if (2 === \count($elements = explode('=', $part, 2))) { if ('expires' === strtolower($elements[0])) { $elements[1] = self::parseDate($elements[1]); } @@ -199,7 +193,7 @@ class Cookie private static function parseDate($dateValue) { // trim single quotes around date if present - if (($length = strlen($dateValue)) > 1 && "'" === $dateValue[0] && "'" === $dateValue[$length - 1]) { + if (($length = \strlen($dateValue)) > 1 && "'" === $dateValue[0] && "'" === $dateValue[$length - 1]) { $dateValue = substr($dateValue, 1, -1); } @@ -248,7 +242,7 @@ class Cookie /** * Gets the expires time of the cookie. * - * @return string The cookie expires time + * @return string|null The cookie expires time */ public function getExpiresTime() {