wp/wp-includes/Requests/Cookie.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
--- a/wp/wp-includes/Requests/Cookie.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/Requests/Cookie.php	Wed Sep 21 18:19:35 2022 +0200
@@ -65,16 +65,16 @@
 	 * @param array|Requests_Utility_CaseInsensitiveDictionary $attributes Associative array of attribute data
 	 */
 	public function __construct($name, $value, $attributes = array(), $flags = array(), $reference_time = null) {
-		$this->name = $name;
-		$this->value = $value;
+		$this->name       = $name;
+		$this->value      = $value;
 		$this->attributes = $attributes;
-		$default_flags = array(
-			'creation' => time(),
+		$default_flags    = array(
+			'creation'    => time(),
 			'last-access' => time(),
-			'persistent' => false,
-			'host-only' => true,
+			'persistent'  => false,
+			'host-only'   => true,
 		);
-		$this->flags = array_merge($default_flags, $flags);
+		$this->flags      = array_merge($default_flags, $flags);
 
 		$this->reference_time = time();
 		if ($reference_time !== null) {
@@ -228,7 +228,7 @@
 	public function normalize() {
 		foreach ($this->attributes as $key => $value) {
 			$orig_value = $value;
-			$value = $this->normalize_attribute($key, $value);
+			$value      = $this->normalize_attribute($key, $value);
 			if ($value === null) {
 				unset($this->attributes[$key]);
 				continue;
@@ -385,7 +385,7 @@
 	 * @return Requests_Cookie Parsed cookie object
 	 */
 	public static function parse($string, $name = '', $reference_time = null) {
-		$parts = explode(';', $string);
+		$parts   = explode(';', $string);
 		$kvparts = array_shift($parts);
 
 		if (!empty($name)) {
@@ -397,13 +397,13 @@
 			// (`=foo`)
 			//
 			// https://bugzilla.mozilla.org/show_bug.cgi?id=169091
-			$name = '';
+			$name  = '';
 			$value = $kvparts;
 		}
 		else {
 			list($name, $value) = explode('=', $kvparts, 2);
 		}
-		$name = trim($name);
+		$name  = trim($name);
 		$value = trim($value);
 
 		// Attribute key are handled case-insensitively
@@ -412,15 +412,15 @@
 		if (!empty($parts)) {
 			foreach ($parts as $part) {
 				if (strpos($part, '=') === false) {
-					$part_key = $part;
+					$part_key   = $part;
 					$part_value = true;
 				}
 				else {
 					list($part_key, $part_value) = explode('=', $part, 2);
-					$part_value = trim($part_value);
+					$part_value                  = trim($part_value);
 				}
 
-				$part_key = trim($part_key);
+				$part_key              = trim($part_key);
 				$attributes[$part_key] = $part_value;
 			}
 		}
@@ -449,7 +449,7 @@
 			// Default domain/path attributes
 			if (empty($parsed->attributes['domain']) && !empty($origin)) {
 				$parsed->attributes['domain'] = $origin->host;
-				$parsed->flags['host-only'] = true;
+				$parsed->flags['host-only']   = true;
 			}
 			else {
 				$parsed->flags['host-only'] = false;
@@ -497,7 +497,7 @@
 	 *
 	 * @codeCoverageIgnore
 	 * @deprecated Use {@see Requests_Cookie::parse_from_headers}
-	 * @return string
+	 * @return array
 	 */
 	public static function parseFromHeaders(Requests_Response_Headers $headers) {
 		return self::parse_from_headers($headers);