Drop usage of goaop, replace implementation with events

This commit is contained in:
ErickSkrauch
2023-11-20 04:39:13 +01:00
parent 2bc83f39cf
commit 16877d502d
27 changed files with 365 additions and 778 deletions

View File

@@ -1,15 +1,11 @@
<?php
namespace api\modules\accounts\models;
use api\aop\annotations\CollectModelMetrics;
use yii\base\ErrorException;
use const common\LATEST_RULES_VERSION;
class AcceptRulesForm extends AccountActionForm {
/**
* @CollectModelMetrics(prefix="accounts.acceptRules")
*/
public function performAction(): bool {
$account = $this->getAccount();
$account->rules_agreement_version = LATEST_RULES_VERSION;

View File

@@ -1,7 +1,6 @@
<?php
namespace api\modules\accounts\models;
use api\aop\annotations\CollectModelMetrics;
use api\validators\EmailActivationKeyValidator;
use common\models\EmailActivation;
use Webmozart\Assert\Assert;
@@ -17,9 +16,6 @@ class ChangeEmailForm extends AccountActionForm {
];
}
/**
* @CollectModelMetrics(prefix="accounts.changeEmail")
*/
public function performAction(): bool {
if (!$this->validate()) {
return false;

View File

@@ -1,7 +1,6 @@
<?php
namespace api\modules\accounts\models;
use api\aop\annotations\CollectModelMetrics;
use common\validators\LanguageValidator;
use Webmozart\Assert\Assert;
@@ -16,9 +15,6 @@ class ChangeLanguageForm extends AccountActionForm {
];
}
/**
* @CollectModelMetrics(prefix="accounts.switchLanguage")
*/
public function performAction(): bool {
if (!$this->validate()) {
return false;

View File

@@ -1,7 +1,6 @@
<?php
namespace api\modules\accounts\models;
use api\aop\annotations\CollectModelMetrics;
use api\components\User\Component;
use api\validators\PasswordRequiredValidator;
use common\helpers\Error as E;
@@ -44,9 +43,6 @@ class ChangePasswordForm extends AccountActionForm {
}
}
/**
* @CollectModelMetrics(prefix="accounts.changePassword")
*/
public function performAction(): bool {
if (!$this->validate()) {
return false;

View File

@@ -1,7 +1,6 @@
<?php
namespace api\modules\accounts\models;
use api\aop\annotations\CollectModelMetrics;
use api\validators\PasswordRequiredValidator;
use common\models\UsernameHistory;
use common\tasks\PullMojangUsername;
@@ -24,9 +23,6 @@ class ChangeUsernameForm extends AccountActionForm {
];
}
/**
* @CollectModelMetrics(prefix="accounts.changeUsername")
*/
public function performAction(): bool {
if (!$this->validate()) {
return false;

View File

@@ -1,7 +1,6 @@
<?php
namespace api\modules\accounts\models;
use api\aop\annotations\CollectModelMetrics;
use api\validators\PasswordRequiredValidator;
use api\validators\TotpValidator;
use common\helpers\Error as E;
@@ -22,9 +21,6 @@ class DisableTwoFactorAuthForm extends AccountActionForm {
];
}
/**
* @CollectModelMetrics(prefix="accounts.disableTwoFactorAuth")
*/
public function performAction(): bool {
if (!$this->validate()) {
return false;

View File

@@ -1,7 +1,6 @@
<?php
namespace api\modules\accounts\models;
use api\aop\annotations\CollectModelMetrics;
use api\components\User\Component;
use api\validators\PasswordRequiredValidator;
use api\validators\TotpValidator;
@@ -24,9 +23,6 @@ class EnableTwoFactorAuthForm extends AccountActionForm {
];
}
/**
* @CollectModelMetrics(prefix="accounts.enableTwoFactorAuth")
*/
public function performAction(): bool {
if (!$this->validate()) {
return false;

View File

@@ -3,7 +3,6 @@ declare(strict_types=1);
namespace api\modules\accounts\models;
use api\aop\annotations\CollectModelMetrics;
use api\validators\PasswordRequiredValidator;
use common\helpers\Error as E;
use common\models\confirmations\CurrentEmailConfirmation;
@@ -37,9 +36,6 @@ class SendEmailVerificationForm extends AccountActionForm {
}
}
/**
* @CollectModelMetrics(prefix="accounts.sendEmailVerification")
*/
public function performAction(): bool {
if (!$this->validate()) {
return false;

View File

@@ -1,7 +1,6 @@
<?php
namespace api\modules\accounts\models;
use api\aop\annotations\CollectModelMetrics;
use api\validators\EmailActivationKeyValidator;
use common\models\confirmations\NewEmailConfirmation;
use common\models\EmailActivation;
@@ -23,9 +22,6 @@ class SendNewEmailVerificationForm extends AccountActionForm {
];
}
/**
* @CollectModelMetrics(prefix="accounts.sendNewEmailVerification")
*/
public function performAction(): bool {
if (!$this->validate()) {
return false;