← All changes
|
includes/libraries/wp-session/class-recursive-arrayaccess.php
+13
-3
1.7.0
→
1.8.13
View file →
| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | * |
| 16 | 16 | * @package WordPress |
| 17 | 17 | * @since 3.7.0 |
| 18 | 18 | */ |
| 19 | -class Recursive_ArrayAccess implements ArrayAccess, Iterator, Countable { | |
| 19 | +class Recursive_ArrayAccess implements ArrayAccess, Iterator, Countable { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- This is a bundled library class. Changing it would break existing functionality. | |
| 20 | 20 | /** |
| 21 | 21 | * Internal data collection. |
| 22 | 22 | * |
| 23 | 23 | * @var array |
| @@ -80,8 +80,9 @@ | ||
| 80 | 80 | * @param mixed $offset An offset to check for. |
| 81 | 81 | * |
| 82 | 82 | * @return boolean true on success or false on failure. |
| 83 | 83 | */ |
| 84 | + #[\ReturnTypeWillChange] | |
| 84 | 85 | public function offsetExists( $offset ) { |
| 85 | 86 | return isset( $this->container[ $offset ]) ; |
| 86 | 87 | } |
| 87 | 88 | |
| @@ -93,8 +94,9 @@ | ||
| 93 | 94 | * @param mixed $offset The offset to retrieve. |
| 94 | 95 | * |
| 95 | 96 | * @return mixed Can return all value types. |
| 96 | 97 | */ |
| 98 | + #[\ReturnTypeWillChange] | |
| 97 | 99 | public function offsetGet( $offset ) { |
| 98 | 100 | return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null; |
| 99 | 101 | } |
| 100 | 102 | |
| @@ -107,8 +109,9 @@ | ||
| 107 | 109 | * @param mixed $value The value to set. |
| 108 | 110 | * |
| 109 | 111 | * @return void |
| 110 | 112 | */ |
| 113 | + #[\ReturnTypeWillChange] | |
| 111 | 114 | public function offsetSet( $offset, $data ) { |
| 112 | 115 | if ( is_array( $data ) ) { |
| 113 | 116 | $data = new self( $data ); |
| 114 | 117 | } |
| @@ -129,15 +132,16 @@ | ||
| 129 | 132 | * @param mixed $offset The offset to unset. |
| 130 | 133 | * |
| 131 | 134 | * @return void |
| 132 | 135 | */ |
| 136 | + #[\ReturnTypeWillChange] | |
| 133 | 137 | public function offsetUnset( $offset ) { |
| 134 | 138 | unset( $this->container[ $offset ] ); |
| 135 | 139 | |
| 136 | 140 | $this->dirty = true; |
| 137 | 141 | } |
| 138 | - | |
| 139 | - | |
| 142 | + | |
| 143 | + | |
| 140 | 144 | /*****************************************************************/ |
| 141 | 145 | /* Iterator Implementation */ |
| 142 | 146 | /*****************************************************************/ |
| 143 | 147 | |
| @@ -147,8 +151,9 @@ | ||
| 147 | 151 | * @link http://php.net/manual/en/iterator.current.php |
| 148 | 152 | * |
| 149 | 153 | * @return mixed |
| 150 | 154 | */ |
| 155 | + #[\ReturnTypeWillChange] | |
| 151 | 156 | public function current() { |
| 152 | 157 | return current( $this->container ); |
| 153 | 158 | } |
| 154 | 159 | |
| @@ -158,8 +163,9 @@ | ||
| 158 | 163 | * @link http://php.net/manual/en/iterator.key.php |
| 159 | 164 | * |
| 160 | 165 | * @return mixed |
| 161 | 166 | */ |
| 167 | + #[\ReturnTypeWillChange] | |
| 162 | 168 | public function key() { |
| 163 | 169 | return key( $this->container ); |
| 164 | 170 | } |
| 165 | 171 | |
| @@ -169,8 +175,9 @@ | ||
| 169 | 175 | * @link http://php.net/manual/en/iterator.next.php |
| 170 | 176 | * |
| 171 | 177 | * @return void |
| 172 | 178 | */ |
| 179 | + #[\ReturnTypeWillChange] | |
| 173 | 180 | public function next() { |
| 174 | 181 | next( $this->container ); |
| 175 | 182 | } |
| 176 | 183 | |
| @@ -180,8 +187,9 @@ | ||
| 180 | 187 | * @link http://php.net/manual/en/iterator.rewind.php |
| 181 | 188 | * |
| 182 | 189 | * @return void |
| 183 | 190 | */ |
| 191 | + #[\ReturnTypeWillChange] | |
| 184 | 192 | public function rewind() { |
| 185 | 193 | reset( $this->container ); |
| 186 | 194 | } |
| 187 | 195 | |
| @@ -191,8 +199,9 @@ | ||
| 191 | 199 | * @link http://php.net/manual/en/iterator.rewind.php |
| 192 | 200 | * |
| 193 | 201 | * @return bool |
| 194 | 202 | */ |
| 203 | + #[\ReturnTypeWillChange] | |
| 195 | 204 | public function valid() { |
| 196 | 205 | return $this->offsetExists( $this->key() ); |
| 197 | 206 | } |
| 198 | 207 | |
| @@ -206,8 +215,9 @@ | ||
| 206 | 215 | * @link http://php.net/manual/en/countable.count.php |
| 207 | 216 | * |
| 208 | 217 | * @return int |
| 209 | 218 | */ |
| 219 | + #[\ReturnTypeWillChange] | |
| 210 | 220 | public function count() { |
| 211 | 221 | return count( $this->container ); |
| 212 | 222 | } |
| 213 | 223 | } |