Skip to content

Make code PHP 8.1 compatible #2

Description

@gbirke

When using the library with PHP 8.1, I'm getting a deprecation error for the ArrayAccess implementations of GlobalSession:

Return type of Jasny\Session\GlobalSession::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/gbirke/src/mealplan/vendor/jasny/session-middleware/src/GlobalSession.php on line 149

Depending on how compatible you want this library to be, you could either add a mixed return type (min. PHP version 8.0) or a #[\ReturnTypeWillChange] (backwards compatible for PHP 7.x) to the methods of the ArrayAccess implementation. The MockSession is probably affected too

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