qarray icon indicating copy to clipboard operation
qarray copied to clipboard

Does not support PHP 8.1

Open mitmelon opened this issue 3 years ago • 1 comments

Getting this error for PHP 8.1

PHP Deprecated: Return type of Nahid\QArray\QueryEngine::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in nahid\qarray\src\QueryEngine.php on line 386

All the implementations functions at ArrayAccess are having same error.

I was only able to update the function offsetExists from

public function offsetExists($key)
    {
        return isset($this->_data[$key]);
    }

to

public function offsetExists(mixed $offset): bool {
    return array_key_exists($offset, $this->_data[$key]);
}

Then I added #[\ReturnTypeWillChange] to the head of other functions to suppress the error.

Please look into this matter and release a version for PHP 8.1

mitmelon avatar May 18 '22 16:05 mitmelon

i would be good to support 8.1+, any update on this thanks

coxy17 avatar Feb 04 '25 19:02 coxy17