Problem/Motivation

This code part is not used anymore anywhere in the code:

    static $anonymous_user;

    if (!isset($anonymous_user)) {
      // Load the anonymous user.
      $anonymous_user = new AnonymousUserSession();
    }

Let's get rid of that.

It was used to be used back in the old days: https://git.drupalcode.org/project/search_api/-/commit/dc21f12ca665a81bc...

Steps to reproduce

Proposed resolution

Remaining tasks

Issue fork search_api-3520656

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mxr576 created an issue. See original summary.

mxr576’s picture

Status: Active » Needs review
scott_euser’s picture

Status: Needs review » Reviewed & tested by the community

This seems right to me; its a static variable that avoids its re-initilisation if the method is called multiple times, yet the variable is never used so it can go.

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Looks perfect, thanks for spotting this!
Merged.

drunken monkey’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.