Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not support PHP 8.1 #10

Open
mitmelon opened this issue May 18, 2022 · 0 comments
Open

Does not support PHP 8.1 #10

mitmelon opened this issue May 18, 2022 · 0 comments

Comments

@mitmelon
Copy link

mitmelon commented May 18, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant