Check of nonexistent? variable in AlternativeUserMailsValidator

Created on 3 March 2024, 10 months ago
Updated 18 March 2024, 9 months ago

Problem/Motivation

In AlternativeUserEmailsValidator.php, there is the following check:

  public function validate($items, Constraint $constraint) {
    if (!$item = $items->first()) {
      return;
    }

The variable $item has not been set though, so this seems to be a mistake. PHPStorm flags this as "Unused local variable 'item'. The value of the variable is overwritten immediately."

Is this check intended to determine whether $items->first() has a value?

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇯🇵Japan ptmkenny

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024