Skip to content

Commit 35eee0b

Browse files
authored
Merge pull request #332 from WordPress/fix/returntypewillchange
Add `ReturnTypeWillChange` attributes / test PHP 8.3
2 parents 0d76779 + 62a5f0a commit 35eee0b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.github/workflows/php-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363
- php: '8.2'
6464
wordpress: 'trunk'
6565
experimental: true
66+
- php: '8.3'
67+
wordpress: 'trunk'
68+
experimental: true
6669
env:
6770
WP_ENV_PHP_VERSION: ${{ matrix.php }}
6871
WP_ENV_CORE: ${{ matrix.wordpress == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wordpress ) }}

includes/Checker/Default_Check_Collection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public function getIterator(): Traversable {
198198
* @param string|int $offset Either a check slug (string) or index (integer).
199199
* @return bool True if a check exists at the given slug or index, false otherwise.
200200
*/
201+
#[\ReturnTypeWillChange]
201202
public function offsetExists( $offset ) {
202203
if ( is_string( $offset ) ) {
203204
return isset( $this->checks[ $offset ] );
@@ -214,6 +215,7 @@ public function offsetExists( $offset ) {
214215
* @param string|int $offset Either a check slug (string) or index (integer).
215216
* @return Check|null Check with the given slug or index, or null if it does not exist.
216217
*/
218+
#[\ReturnTypeWillChange]
217219
public function offsetGet( $offset ) {
218220
if ( is_string( $offset ) ) {
219221
if ( isset( $this->checks[ $offset ] ) ) {
@@ -239,6 +241,7 @@ public function offsetGet( $offset ) {
239241
* @param string|int $offset Either a check slug (string) or index (integer).
240242
* @param mixed $value Value to set.
241243
*/
244+
#[\ReturnTypeWillChange]
242245
public function offsetSet( $offset, $value ) {
243246
// Not implemented as this is a read-only collection.
244247
}
@@ -252,6 +255,7 @@ public function offsetSet( $offset, $value ) {
252255
*
253256
* @param string|int $offset Either a check slug (string) or index (integer).
254257
*/
258+
#[\ReturnTypeWillChange]
255259
public function offsetUnset( $offset ) {
256260
// Not implemented as this is a read-only collection.
257261
}

0 commit comments

Comments
 (0)