Close #109 provide better error classes + phpdoc fixes
This commit is contained in:
@ -35,6 +35,8 @@ class PermissionController extends AbstractAuthItemController
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
protected function getItem($name)
|
||||
{
|
||||
|
||||
@ -24,6 +24,8 @@ use Da\User\Service\ResetPasswordService;
|
||||
use Da\User\Traits\ContainerAwareTrait;
|
||||
use Da\User\Validator\AjaxRequestModelValidator;
|
||||
use Yii;
|
||||
use yii\base\InvalidConfigException;
|
||||
use yii\base\InvalidParamException;
|
||||
use yii\filters\AccessControl;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
@ -74,6 +76,8 @@ class RecoveryController extends Controller
|
||||
* Displays / handles user password recovery request.
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
* @throws InvalidConfigException
|
||||
* @throws InvalidParamException
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
@ -118,6 +122,8 @@ class RecoveryController extends Controller
|
||||
* @param $code
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
* @throws InvalidConfigException
|
||||
* @throws InvalidParamException
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
|
||||
@ -35,6 +35,8 @@ class RoleController extends AbstractAuthItemController
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
protected function getItem($name)
|
||||
{
|
||||
|
||||
@ -21,6 +21,8 @@ use Da\User\Service\SocialNetworkAuthenticateService;
|
||||
use Da\User\Traits\ContainerAwareTrait;
|
||||
use Yii;
|
||||
use yii\authclient\AuthAction;
|
||||
use yii\base\InvalidConfigException;
|
||||
use yii\base\InvalidParamException;
|
||||
use yii\base\Module;
|
||||
use yii\filters\AccessControl;
|
||||
use yii\filters\VerbFilter;
|
||||
@ -102,6 +104,8 @@ class SecurityController extends Controller
|
||||
/**
|
||||
* Controller action responsible for handling login page and actions.
|
||||
*
|
||||
* @throws InvalidConfigException
|
||||
* @throws InvalidParamException
|
||||
* @return array|string|Response
|
||||
*/
|
||||
public function actionLogin()
|
||||
|
||||
@ -179,7 +179,7 @@ class SettingsController extends Controller
|
||||
{
|
||||
$user = $this->userQuery->whereId($id)->one();
|
||||
|
||||
if ($user === null || $this->module->emailChangeStrategy == MailChangeStrategyInterface::TYPE_INSECURE) {
|
||||
if ($user === null || MailChangeStrategyInterface::TYPE_INSECURE === $this->module->emailChangeStrategy) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
$event = $this->make(UserEvent::class, [$user]);
|
||||
@ -210,7 +210,7 @@ class SettingsController extends Controller
|
||||
if ($account === null) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
if ($account->user_id != Yii::$app->user->id) {
|
||||
if ($account->user_id !== Yii::$app->user->id) {
|
||||
throw new ForbiddenHttpException();
|
||||
}
|
||||
$event = $this->make(SocialNetworkConnectEvent::class, [Yii::$app->user->identity, $account]);
|
||||
|
||||
Reference in New Issue
Block a user