account instanceof Account) { throw new InvalidConfigException('account should be instance of ' . Account::class); } $this->user = Instance::ensure($this->user, User::class); } protected function validateValue($value) { if ($this->user->can(P::ESCAPE_IDENTITY_VERIFICATION)) { return null; } if (empty($value)) { return [E::PASSWORD_REQUIRED, []]; } if ($this->account->validatePassword($value) === false) { return [E::PASSWORD_INCORRECT, []]; } return null; } }