Skip to content

Commit deb2bea

Browse files
committed
Silence PHP 8.1 deprecation warnings
1 parent 6564ffd commit deb2bea

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

includes/Plugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public function __call( $name, $args ) {
161161
*
162162
* @return bool
163163
*/
164+
#[\ReturnTypeWillChange]
164165
public function offsetExists( $offset ) {
165166
return array_key_exists( $offset, self::HEADERS ) || in_array( $offset, array( 'basename', 'file', 'slug' ), true );
166167
}
@@ -172,6 +173,7 @@ public function offsetExists( $offset ) {
172173
*
173174
* @return string
174175
*/
176+
#[\ReturnTypeWillChange]
175177
public function offsetGet( $offset ) {
176178
if ( method_exists( $this, $offset ) ) {
177179
return $this->{$offset}();
@@ -191,6 +193,7 @@ public function offsetGet( $offset ) {
191193
*
192194
* @throws \Exception If called.
193195
*/
196+
#[\ReturnTypeWillChange]
194197
public function offsetSet( $offset, $value ) {
195198
throw new \Exception( 'Setting plugin values is not allowed!' );
196199
}
@@ -202,6 +205,7 @@ public function offsetSet( $offset, $value ) {
202205
*
203206
* @throws \Exception If called.
204207
*/
208+
#[\ReturnTypeWillChange]
205209
public function offsetUnset( $offset ) {
206210
throw new \Exception( 'Unsetting plugin values is not allowed!' );
207211
}

0 commit comments

Comments
 (0)