Skip to content

Incorrect warning about redeclaration of function parameter as static variable #280

Closed
@mxr576

Description

@mxr576

I believe there is still a regression related to static variables even after #272 and #275.

The following code leads to an invalid concern raised by the checker on the last line in the example.

      $developer_team_ids = array_map(static function (GroupInterface $group) {
        return (int) $group->id();
      }, ($this->getTeamsByUserQuery)((int) $account->id()));
Redeclaration of function parameter $account as static variable.
(DrupalPractice.CodeAnalysis.VariableAnalysis.VariableRedeclaration)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions