Skip to content

Commit 0a87874

Browse files
committed
Requests: apply patch / PR 505
1 parent 8e2943b commit 0a87874

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/wp-includes/Requests/Cookie/Jar.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function normalizeCookie($cookie, $key = null) {
6060
* @param string $key Item key
6161
* @return boolean Does the item exist?
6262
*/
63+
#[ReturnTypeWillChange]
6364
public function offsetExists($key) {
6465
return isset($this->cookies[$key]);
6566
}
@@ -70,6 +71,7 @@ public function offsetExists($key) {
7071
* @param string $key Item key
7172
* @return string|null Item value (null if offsetExists is false)
7273
*/
74+
#[ReturnTypeWillChange]
7375
public function offsetGet($key) {
7476
if (!isset($this->cookies[$key])) {
7577
return null;
@@ -86,6 +88,7 @@ public function offsetGet($key) {
8688
* @param string $key Item name
8789
* @param string $value Item value
8890
*/
91+
#[ReturnTypeWillChange]
8992
public function offsetSet($key, $value) {
9093
if ($key === null) {
9194
throw new Requests_Exception('Object is a dictionary, not a list', 'invalidset');
@@ -99,6 +102,7 @@ public function offsetSet($key, $value) {
99102
*
100103
* @param string $key
101104
*/
105+
#[ReturnTypeWillChange]
102106
public function offsetUnset($key) {
103107
unset($this->cookies[$key]);
104108
}
@@ -108,6 +112,7 @@ public function offsetUnset($key) {
108112
*
109113
* @return ArrayIterator
110114
*/
115+
#[ReturnTypeWillChange]
111116
public function getIterator() {
112117
return new ArrayIterator($this->cookies);
113118
}

src/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct(array $data = array()) {
3737
* @param string $key Item key
3838
* @return boolean Does the item exist?
3939
*/
40+
#[ReturnTypeWillChange]
4041
public function offsetExists($key) {
4142
$key = strtolower($key);
4243
return isset($this->data[$key]);
@@ -48,6 +49,7 @@ public function offsetExists($key) {
4849
* @param string $key Item key
4950
* @return string|null Item value (null if offsetExists is false)
5051
*/
52+
#[ReturnTypeWillChange]
5153
public function offsetGet($key) {
5254
$key = strtolower($key);
5355
if (!isset($this->data[$key])) {
@@ -65,6 +67,7 @@ public function offsetGet($key) {
6567
* @param string $key Item name
6668
* @param string $value Item value
6769
*/
70+
#[ReturnTypeWillChange]
6871
public function offsetSet($key, $value) {
6972
if ($key === null) {
7073
throw new Requests_Exception('Object is a dictionary, not a list', 'invalidset');
@@ -79,6 +82,7 @@ public function offsetSet($key, $value) {
7982
*
8083
* @param string $key
8184
*/
85+
#[ReturnTypeWillChange]
8286
public function offsetUnset($key) {
8387
unset($this->data[strtolower($key)]);
8488
}
@@ -88,6 +92,7 @@ public function offsetUnset($key) {
8892
*
8993
* @return ArrayIterator
9094
*/
95+
#[ReturnTypeWillChange]
9196
public function getIterator() {
9297
return new ArrayIterator($this->data);
9398
}

src/wp-includes/Requests/Utility/FilteredIterator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct($data, $callback) {
3737
*
3838
* @return string
3939
*/
40+
#[ReturnTypeWillChange]
4041
public function current() {
4142
$value = parent::current();
4243

@@ -50,13 +51,15 @@ public function current() {
5051
/**
5152
* @inheritdoc
5253
*/
54+
#[ReturnTypeWillChange]
5355
public function unserialize($serialized) {}
5456

5557
/**
5658
* @inheritdoc
5759
*
5860
* @phpcs:disable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
5961
*/
62+
#[ReturnTypeWillChange]
6063
public function __unserialize($serialized) {}
6164

6265
public function __wakeup() {

0 commit comments

Comments
 (0)