phpstan: missing service returns

This commit is contained in:
tonis ormisson
2022-08-10 16:48:03 +03:00
parent 197a6b7636
commit 3e33813fd5
3 changed files with 7 additions and 0 deletions

View File

@ -67,6 +67,7 @@ class SocialNetworkAuthenticateService implements ServiceInterface
$event = Yii::createObject(SocialNetworkAuthEvent::class, [$account, $this->client]);
$this->controller->trigger(SocialNetworkAuthEvent::EVENT_BEFORE_AUTHENTICATE, $event);
$result = false;
if ($account->user instanceof User) {
if ($account->user->getIsBlocked()) {
@ -75,12 +76,15 @@ class SocialNetworkAuthenticateService implements ServiceInterface
} else {
Yii::$app->user->login($account->user, $this->controller->module->rememberLoginLifespan);
$this->authAction->setSuccessUrl(Yii::$app->getUser()->getReturnUrl());
$result = true;
}
} else {
$this->authAction->setSuccessUrl($account->getConnectionUrl());
$result = true;
}
$this->controller->trigger(SocialNetworkAuthEvent::EVENT_AFTER_AUTHENTICATE, $event);
return $result;
}
protected function createAccount()

View File

@ -65,5 +65,6 @@ class SwitchIdentityService implements ServiceInterface
/** @var IdentityInterface $user */
Yii::$app->user->switchIdentity($user, $session->timeout);
$this->controller->trigger(UserEvent::EVENT_AFTER_SWITCH_IDENTITY, $event);
return true;
}
}