Skip to content

Does not support PHP 8.1 #10

Description

@mitmelon

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions