Skip to content

Commit

Permalink
Matrix: PHP 8.1 compatibility
Browse files Browse the repository at this point in the history
ArrayAccess now has tentative return types, which cause deprecation warnings to be generated.
  • Loading branch information
dktapps committed Dec 3, 2021
1 parent c60f6e1 commit f7eb462
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ 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]);
}

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]);
}

Expand Down

0 comments on commit f7eb462

Please # to comment.