phpstan: missing declared return
This commit is contained in:
@ -76,14 +76,14 @@ class UserCreateService implements ServiceInterface
|
|||||||
['email' => $model->email]
|
['email' => $model->email]
|
||||||
);
|
);
|
||||||
// from web display a flash message (if enabled)
|
// from web display a flash message (if enabled)
|
||||||
if ($this->getModule()->enableFlashMessages === true && is_a(Yii::$app, yii\web\Application::class)) {
|
if ($this->getModule()->enableFlashMessages === true && is_a(Yii::$app, "yii\web\Application")) {
|
||||||
Yii::$app->session->setFlash(
|
Yii::$app->session->setFlash(
|
||||||
'warning',
|
'warning',
|
||||||
$error_msg
|
$error_msg
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// if we're from console add an error to the model in order to return an error message
|
// if we're from console add an error to the model in order to return an error message
|
||||||
if (is_a(Yii::$app, yii\console\Application::class)) {
|
if (is_a(Yii::$app, "yii\console\Application")) {
|
||||||
$model->addError('username', $error_msg);
|
$model->addError('username', $error_msg);
|
||||||
}
|
}
|
||||||
$transaction->rollBack();
|
$transaction->rollBack();
|
||||||
|
|||||||
@ -32,9 +32,12 @@ class AjaxRequestModelValidator implements ValidatorInterface
|
|||||||
|
|
||||||
if ($request->getIsAjax() && $this->model->load($request->post())) {
|
if ($request->getIsAjax() && $this->model->load($request->post())) {
|
||||||
Yii::$app->response->format = Response::FORMAT_JSON;
|
Yii::$app->response->format = Response::FORMAT_JSON;
|
||||||
Yii::$app->response->data = ActiveForm::validate($this->model);
|
$result = ActiveForm::validate($this->model);
|
||||||
|
Yii::$app->response->data = $result;
|
||||||
Yii::$app->response->send();
|
Yii::$app->response->send();
|
||||||
Yii::$app->end();
|
Yii::$app->end();
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,4 +31,3 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
) ?>
|
) ?>
|
||||||
|
|
||||||
<?php $this->endContent() ?>
|
<?php $this->endContent() ?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user