diff --git a/src/applications/auth/action/PhabricatorAuthChangePasswordAction.php b/src/applications/auth/action/PhabricatorAuthChangePasswordAction.php index 323c3e65b6..41aac1ec12 100644 --- a/src/applications/auth/action/PhabricatorAuthChangePasswordAction.php +++ b/src/applications/auth/action/PhabricatorAuthChangePasswordAction.php @@ -5,10 +5,6 @@ final class PhabricatorAuthChangePasswordAction const TYPECONST = 'auth.password'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 20 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/auth/action/PhabricatorAuthEmailLoginAction.php b/src/applications/auth/action/PhabricatorAuthEmailLoginAction.php index c7729047b4..97fe5b48e1 100644 --- a/src/applications/auth/action/PhabricatorAuthEmailLoginAction.php +++ b/src/applications/auth/action/PhabricatorAuthEmailLoginAction.php @@ -4,10 +4,6 @@ final class PhabricatorAuthEmailLoginAction extends PhabricatorSystemAction { const TYPECONST = 'mail.login'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 3 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/auth/action/PhabricatorAuthNewFactorAction.php b/src/applications/auth/action/PhabricatorAuthNewFactorAction.php index c1244587f1..82b851d383 100644 --- a/src/applications/auth/action/PhabricatorAuthNewFactorAction.php +++ b/src/applications/auth/action/PhabricatorAuthNewFactorAction.php @@ -4,10 +4,6 @@ final class PhabricatorAuthNewFactorAction extends PhabricatorSystemAction { const TYPECONST = 'auth.factor.new'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 60 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/auth/action/PhabricatorAuthTestSMSAction.php b/src/applications/auth/action/PhabricatorAuthTestSMSAction.php index d0f4a6bb7e..a03f4d6877 100644 --- a/src/applications/auth/action/PhabricatorAuthTestSMSAction.php +++ b/src/applications/auth/action/PhabricatorAuthTestSMSAction.php @@ -4,10 +4,6 @@ final class PhabricatorAuthTestSMSAction extends PhabricatorSystemAction { const TYPECONST = 'auth.sms.test'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 60 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/auth/action/PhabricatorAuthTryEmailLoginAction.php b/src/applications/auth/action/PhabricatorAuthTryEmailLoginAction.php index 001358e3f6..abb1a6c099 100644 --- a/src/applications/auth/action/PhabricatorAuthTryEmailLoginAction.php +++ b/src/applications/auth/action/PhabricatorAuthTryEmailLoginAction.php @@ -5,10 +5,6 @@ final class PhabricatorAuthTryEmailLoginAction const TYPECONST = 'mail.try-login'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 20 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/auth/action/PhabricatorAuthTryFactorAction.php b/src/applications/auth/action/PhabricatorAuthTryFactorAction.php index 246298567b..d57b481213 100644 --- a/src/applications/auth/action/PhabricatorAuthTryFactorAction.php +++ b/src/applications/auth/action/PhabricatorAuthTryFactorAction.php @@ -4,10 +4,6 @@ final class PhabricatorAuthTryFactorAction extends PhabricatorSystemAction { const TYPECONST = 'auth.factor'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 10 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/auth/action/PhabricatorAuthTryPasswordAction.php b/src/applications/auth/action/PhabricatorAuthTryPasswordAction.php index 440cbf301e..9ec6799c38 100644 --- a/src/applications/auth/action/PhabricatorAuthTryPasswordAction.php +++ b/src/applications/auth/action/PhabricatorAuthTryPasswordAction.php @@ -5,10 +5,6 @@ final class PhabricatorAuthTryPasswordAction const TYPECONST = 'auth.password'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 100 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/auth/action/PhabricatorAuthTryPasswordWithoutCAPTCHAAction.php b/src/applications/auth/action/PhabricatorAuthTryPasswordWithoutCAPTCHAAction.php index ee6433a9ee..0e09820273 100644 --- a/src/applications/auth/action/PhabricatorAuthTryPasswordWithoutCAPTCHAAction.php +++ b/src/applications/auth/action/PhabricatorAuthTryPasswordWithoutCAPTCHAAction.php @@ -5,10 +5,6 @@ final class PhabricatorAuthTryPasswordWithoutCAPTCHAAction const TYPECONST = 'auth.password-without-captcha'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 10 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/files/action/PhabricatorFilesOutboundRequestAction.php b/src/applications/files/action/PhabricatorFilesOutboundRequestAction.php index acba2f8882..7a1d3d2d56 100644 --- a/src/applications/files/action/PhabricatorFilesOutboundRequestAction.php +++ b/src/applications/files/action/PhabricatorFilesOutboundRequestAction.php @@ -5,10 +5,6 @@ final class PhabricatorFilesOutboundRequestAction const TYPECONST = 'files.outbound'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 60 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/metamta/action/PhabricatorMetaMTAErrorMailAction.php b/src/applications/metamta/action/PhabricatorMetaMTAErrorMailAction.php index 0bc8b29172..cabb8c82b0 100644 --- a/src/applications/metamta/action/PhabricatorMetaMTAErrorMailAction.php +++ b/src/applications/metamta/action/PhabricatorMetaMTAErrorMailAction.php @@ -2,9 +2,7 @@ final class PhabricatorMetaMTAErrorMailAction extends PhabricatorSystemAction { - public function getActionConstant() { - return 'email.error'; - } + const TYPECONST = 'email.error'; public function getScoreThreshold() { return 6 / phutil_units('1 hour in seconds'); diff --git a/src/applications/phortune/action/PhortuneAddPaymentMethodAction.php b/src/applications/phortune/action/PhortuneAddPaymentMethodAction.php index 09a8cd2f5d..5f32e67cee 100644 --- a/src/applications/phortune/action/PhortuneAddPaymentMethodAction.php +++ b/src/applications/phortune/action/PhortuneAddPaymentMethodAction.php @@ -5,10 +5,6 @@ final class PhortuneAddPaymentMethodAction const TYPECONST = 'phortune.payment-method.add'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 60 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/settings/action/PhabricatorSettingsAddEmailAction.php b/src/applications/settings/action/PhabricatorSettingsAddEmailAction.php index 764db7f543..4038e37c9f 100644 --- a/src/applications/settings/action/PhabricatorSettingsAddEmailAction.php +++ b/src/applications/settings/action/PhabricatorSettingsAddEmailAction.php @@ -4,10 +4,6 @@ final class PhabricatorSettingsAddEmailAction extends PhabricatorSystemAction { const TYPECONST = 'email.add'; - public function getActionConstant() { - return self::TYPECONST; - } - public function getScoreThreshold() { return 6 / phutil_units('1 hour in seconds'); } diff --git a/src/applications/system/action/PhabricatorSystemAction.php b/src/applications/system/action/PhabricatorSystemAction.php index 329824bacc..b712dfca8c 100644 --- a/src/applications/system/action/PhabricatorSystemAction.php +++ b/src/applications/system/action/PhabricatorSystemAction.php @@ -2,7 +2,10 @@ abstract class PhabricatorSystemAction extends Phobject { - abstract public function getActionConstant(); + final public function getActionConstant() { + return $this->getPhobjectClassConstant('TYPECONST', 32); + } + abstract public function getScoreThreshold(); public function shouldBlockActor($actor, $score) {