mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Implemented PHP-CS-Fixer support
This commit is contained in:
@@ -4,9 +4,9 @@ namespace api\models\authentication;
|
||||
use api\aop\annotations\CollectModelMetrics;
|
||||
use api\components\ReCaptcha\Validator as ReCaptchaValidator;
|
||||
use api\models\base\ApiForm;
|
||||
use common\helpers\Error as E;
|
||||
use api\traits\AccountFinder;
|
||||
use common\components\UserFriendlyRandomKey;
|
||||
use common\helpers\Error as E;
|
||||
use common\models\Account;
|
||||
use common\models\confirmations\ForgotPassword;
|
||||
use common\models\EmailActivation;
|
||||
|
@@ -3,9 +3,9 @@ namespace api\models\authentication;
|
||||
|
||||
use api\aop\annotations\CollectModelMetrics;
|
||||
use api\models\base\ApiForm;
|
||||
use api\traits\AccountFinder;
|
||||
use api\validators\TotpValidator;
|
||||
use common\helpers\Error as E;
|
||||
use api\traits\AccountFinder;
|
||||
use common\models\Account;
|
||||
use Yii;
|
||||
|
||||
@@ -13,8 +13,11 @@ class LoginForm extends ApiForm {
|
||||
use AccountFinder;
|
||||
|
||||
public $login;
|
||||
|
||||
public $password;
|
||||
|
||||
public $totp;
|
||||
|
||||
public $rememberMe = false;
|
||||
|
||||
public function rules(): array {
|
||||
|
@@ -11,7 +11,7 @@ class LogoutForm extends ApiForm {
|
||||
* @CollectModelMetrics(prefix="authentication.logout")
|
||||
* @return bool
|
||||
*/
|
||||
public function logout() : bool {
|
||||
public function logout(): bool {
|
||||
$component = Yii::$app->user;
|
||||
$session = $component->getActiveSession();
|
||||
if ($session === null) {
|
||||
|
@@ -4,8 +4,8 @@ namespace api\models\authentication;
|
||||
use api\aop\annotations\CollectModelMetrics;
|
||||
use api\components\ReCaptcha\Validator as ReCaptchaValidator;
|
||||
use api\models\base\ApiForm;
|
||||
use common\helpers\Error as E;
|
||||
use common\components\UserFriendlyRandomKey;
|
||||
use common\helpers\Error as E;
|
||||
use common\models\Account;
|
||||
use common\models\confirmations\RegistrationConfirmation;
|
||||
use common\models\UsernameHistory;
|
||||
@@ -126,7 +126,7 @@ class RegistrationForm extends ApiForm {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function canContinue(array $errors) : bool {
|
||||
protected function canContinue(array $errors): bool {
|
||||
if (ArrayHelper::getValue($errors, 'username') === E::USERNAME_NOT_AVAILABLE) {
|
||||
$duplicatedUsername = Account::findOne([
|
||||
'username' => $this->username,
|
||||
|
@@ -5,8 +5,8 @@ use api\aop\annotations\CollectModelMetrics;
|
||||
use api\components\ReCaptcha\Validator as ReCaptchaValidator;
|
||||
use api\exceptions\ThisShouldNotHappenException;
|
||||
use api\models\base\ApiForm;
|
||||
use common\helpers\Error as E;
|
||||
use common\components\UserFriendlyRandomKey;
|
||||
use common\helpers\Error as E;
|
||||
use common\models\Account;
|
||||
use common\models\confirmations\RegistrationConfirmation;
|
||||
use common\models\EmailActivation;
|
||||
|
Reference in New Issue
Block a user