Implemented PHP-CS-Fixer support

This commit is contained in:
ErickSkrauch
2018-04-17 23:47:25 +03:00
parent bfdcaf2233
commit 02ea7346a8
115 changed files with 883 additions and 363 deletions

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -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,

View File

@@ -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;