account === null) { $this->account = Yii::$app->user->identity; } if (!$this->account instanceof Account) { throw new InvalidConfigException('account should be instance of ' . Account::class); } } protected function validateValue($value) { if (empty($value)) { return [E::PASSWORD_REQUIRED, []]; } if ($this->account->validatePassword($value) === false) { return [E::PASSWORD_INVALID, []]; } return null; } }