From f7eb4629cc0bc4a27dd334d36c156b56439da34e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 3 Dec 2021 14:24:11 +0000 Subject: [PATCH] Matrix: PHP 8.1 compatibility ArrayAccess now has tentative return types, which cause deprecation warnings to be generated. --- src/Matrix.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Matrix.php b/src/Matrix.php index 572b2e9..cfd1f88 100644 --- a/src/Matrix.php +++ b/src/Matrix.php @@ -36,7 +36,7 @@ class Matrix implements \ArrayAccess{ private int $rows; private int $columns; - public function offsetExists($offset){ + public function offsetExists($offset) : bool{ return isset($this->matrix[(int) $offset]); } @@ -44,11 +44,11 @@ public function offsetGet($offset){ return $this->matrix[(int) $offset]; } - public function offsetSet($offset, $value){ + public function offsetSet($offset, $value) : void{ $this->matrix[(int) $offset] = $value; } - public function offsetUnset($offset){ + public function offsetUnset($offset) : void{ unset($this->matrix[(int) $offset]); }