userQuery = $userQuery; parent::__construct($id, $module, $config); } public function actionIndex($usernameOrEmail, $password) { /** @var User $user */ $user = $this->userQuery->whereUsernameOrEmail($usernameOrEmail)->one(); if ($user === null) { $this->stdout(Yii::t('user', 'User is not found') . "\n", Console::FG_RED); } else { if ($this->make(ResetPasswordService::class, [$password, $user])->run()) { $this->stdout(Yii::t('user', 'Password has been changed') . "\n", Console::FG_GREEN); } else { $this->stdout(Yii::t('user', 'Error occurred while changing password') . "\n", Console::FG_RED); } } } }