diff --git a/.phpcs.xml b/.phpcs.xml index 5bcdea43..b915cf83 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -1,10 +1,6 @@ - - - - - + . diff --git a/FancyCaptcha/includes/FancyCaptcha.php b/FancyCaptcha/includes/FancyCaptcha.php index 957aedec..387c7418 100644 --- a/FancyCaptcha/includes/FancyCaptcha.php +++ b/FancyCaptcha/includes/FancyCaptcha.php @@ -22,8 +22,10 @@ use UnderflowException; * FancyCaptcha for displaying captchas precomputed by captcha.py */ class FancyCaptcha extends SimpleCaptcha { - // used for fancycaptcha-edit, fancycaptcha-addurl, fancycaptcha-badlogin, - // fancycaptcha-accountcreate, fancycaptcha-create, fancycaptcha-sendemail via getMessage() + /** + * @var string used for fancycaptcha-edit, fancycaptcha-addurl, fancycaptcha-badlogin, + * fancycaptcha-accountcreate, fancycaptcha-create, fancycaptcha-sendemail via getMessage() + */ protected static $messagePrefix = 'fancycaptcha-'; /** diff --git a/FancyCaptcha/includes/HTMLFancyCaptchaField.php b/FancyCaptcha/includes/HTMLFancyCaptchaField.php index 630fa211..6be96803 100644 --- a/FancyCaptcha/includes/HTMLFancyCaptchaField.php +++ b/FancyCaptcha/includes/HTMLFancyCaptchaField.php @@ -16,6 +16,7 @@ class HTMLFancyCaptchaField extends HTMLFormField { /** @var bool */ protected $showCreateHelp; + /** @var string */ protected $mClass = 'captcha'; /** diff --git a/QuestyCaptcha/includes/QuestyCaptcha.php b/QuestyCaptcha/includes/QuestyCaptcha.php index 05ce415c..cccef429 100644 --- a/QuestyCaptcha/includes/QuestyCaptcha.php +++ b/QuestyCaptcha/includes/QuestyCaptcha.php @@ -19,8 +19,10 @@ use MediaWiki\Html\Html; use Xml; class QuestyCaptcha extends SimpleCaptcha { - // used for questycaptcha-edit, questycaptcha-addurl, questycaptcha-badlogin, - // questycaptcha-createaccount, questycaptcha-create, questycaptcha-sendemail via getMessage() + /** + * @var string used for questycaptcha-edit, questycaptcha-addurl, questycaptcha-badlogin, + * questycaptcha-createaccount, questycaptcha-create, questycaptcha-sendemail via getMessage() + */ protected static $messagePrefix = 'questycaptcha-'; /** diff --git a/ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptcha.php b/ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptcha.php index 16218523..e359948b 100644 --- a/ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptcha.php +++ b/ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptcha.php @@ -16,10 +16,13 @@ use MediaWiki\Request\WebRequest; use MediaWiki\Status\Status; class ReCaptchaNoCaptcha extends SimpleCaptcha { - // used for renocaptcha-edit, renocaptcha-addurl, renocaptcha-badlogin, renocaptcha-createaccount, - // renocaptcha-create, renocaptcha-sendemail via getMessage() + /** + * @var string used for renocaptcha-edit, renocaptcha-addurl, renocaptcha-badlogin, renocaptcha-createaccount, + * renocaptcha-create, renocaptcha-sendemail via getMessage() + */ protected static $messagePrefix = 'renocaptcha-'; + /** @var string|null */ private $error = null; /** diff --git a/SimpleCaptcha/SimpleCaptcha.php b/SimpleCaptcha/SimpleCaptcha.php index 3d06ef59..c265fb43 100644 --- a/SimpleCaptcha/SimpleCaptcha.php +++ b/SimpleCaptcha/SimpleCaptcha.php @@ -45,6 +45,7 @@ use WikiPage; * Demo CAPTCHA (not for production usage) and base class for real CAPTCHAs */ class SimpleCaptcha { + /** @var string */ protected static $messagePrefix = 'captcha-'; /** @var bool Override to force showing the CAPTCHA to users who don't have "skipcaptcha" right. */ diff --git a/Turnstile/includes/Turnstile.php b/Turnstile/includes/Turnstile.php index ca2201de..355b4e32 100644 --- a/Turnstile/includes/Turnstile.php +++ b/Turnstile/includes/Turnstile.php @@ -16,10 +16,13 @@ use MediaWiki\Request\WebRequest; use MediaWiki\Status\Status; class Turnstile extends SimpleCaptcha { - // used for turnstile-edit, turnstile-addurl, turnstile-badlogin, turnstile-createaccount, - // turnstile-create, turnstile-sendemail via getMessage() + /** + * @var string used for turnstile-edit, turnstile-addurl, turnstile-badlogin, turnstile-createaccount, + * turnstile-create, turnstile-sendemail via getMessage() + */ protected static $messagePrefix = 'turnstile-'; + /** @var string|null */ private $error = null; /** diff --git a/hCaptcha/includes/HCaptcha.php b/hCaptcha/includes/HCaptcha.php index b699f6f2..a27afe63 100644 --- a/hCaptcha/includes/HCaptcha.php +++ b/hCaptcha/includes/HCaptcha.php @@ -5,6 +5,7 @@ namespace MediaWiki\Extension\ConfirmEdit\hCaptcha; use ApiBase; use FormatJson; use MediaWiki\Auth\AuthenticationRequest; +use MediaWiki\Config\Config; use MediaWiki\Context\RequestContext; use MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest; use MediaWiki\Extension\ConfirmEdit\Hooks; @@ -18,14 +19,19 @@ use MediaWiki\Request\WebRequest; use MediaWiki\Status\Status; class HCaptcha extends SimpleCaptcha { - // used for hcaptcha-edit, hcaptcha-addurl, hcaptcha-badlogin, hcaptcha-createaccount, - // hcaptcha-create, hcaptcha-sendemail via getMessage() + /** + * @var string used for hcaptcha-edit, hcaptcha-addurl, hcaptcha-badlogin, hcaptcha-createaccount, + * hcaptcha-create, hcaptcha-sendemail via getMessage() + */ protected static $messagePrefix = 'hcaptcha-'; + /** @var string|null */ private $error = null; + /** @var Config */ private $hCaptchaConfig; + /** @var string */ private $siteKey; public function __construct() { diff --git a/includes/Hooks.php b/includes/Hooks.php index 73dd5a38..a1012c5d 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -53,6 +53,7 @@ class Hooks implements AuthChangeFormFieldsHook { + /** @var bool */ protected static $instanceCreated = false; private WANObjectCache $cache; diff --git a/includes/Store/CaptchaHashStore.php b/includes/Store/CaptchaHashStore.php index d98b97c2..f66617f4 100644 --- a/includes/Store/CaptchaHashStore.php +++ b/includes/Store/CaptchaHashStore.php @@ -3,6 +3,7 @@ namespace MediaWiki\Extension\ConfirmEdit\Store; class CaptchaHashStore extends CaptchaStore { + /** @var array */ protected $data = []; /**