From 957f6c6a5714a8e5dff2abb8bded4ec11eabc22a Mon Sep 17 00:00:00 2001 From: snipershady Date: Fri, 29 Dec 2023 18:48:06 +0000 Subject: [PATCH] Removed all class attributes due for legacy compatibility --- src/Extension/ReCaptcha/RequestMethod/Post.php | 6 +++--- src/Extension/ReCaptcha/RequestMethod/ProxyPost.php | 8 ++++---- src/Form/Type/EWZRecaptchaType.php | 7 ++++--- src/Form/Type/EWZRecaptchaV3Type.php | 2 +- src/Locale/LocaleResolver.php | 6 +++--- src/Validator/Constraints/IsTrue.php | 3 ++- src/Validator/Constraints/IsTrueV3.php | 4 +++- src/Validator/Constraints/IsTrueValidator.php | 8 ++++---- src/Validator/Constraints/IsTrueValidatorV3.php | 12 ++++++------ 9 files changed, 30 insertions(+), 26 deletions(-) diff --git a/src/Extension/ReCaptcha/RequestMethod/Post.php b/src/Extension/ReCaptcha/RequestMethod/Post.php index f4caac9..521741b 100644 --- a/src/Extension/ReCaptcha/RequestMethod/Post.php +++ b/src/Extension/ReCaptcha/RequestMethod/Post.php @@ -15,17 +15,17 @@ class Post implements RequestMethod * * @var string */ - private string $recaptchaVerifyUrl; + private $recaptchaVerifyUrl; /** * The timeout for the reCAPTCHA verification. * * @var int|null */ - private ?int $timeout; + private $timeout; /** @var array */ - private array $cache; + private $cache; /** * Constructor. diff --git a/src/Extension/ReCaptcha/RequestMethod/ProxyPost.php b/src/Extension/ReCaptcha/RequestMethod/ProxyPost.php index fb1cae8..4afdbf4 100644 --- a/src/Extension/ReCaptcha/RequestMethod/ProxyPost.php +++ b/src/Extension/ReCaptcha/RequestMethod/ProxyPost.php @@ -15,24 +15,24 @@ class ProxyPost implements RequestMethod * * @var array */ - private array $httpProxy; + private $httpProxy; /** * The reCAPTCHA verify server URL. * * @var string */ - private string $recaptchaVerifyUrl; + private $recaptchaVerifyUrl; /** * The timeout for the reCAPTCHA verification. * * @var int|null */ - private ?int $timeout; + private $timeout; /** @var array */ - private array $cache; + private $cache; /** * Constructor. diff --git a/src/Form/Type/EWZRecaptchaType.php b/src/Form/Type/EWZRecaptchaType.php index 90a80fe..d997270 100755 --- a/src/Form/Type/EWZRecaptchaType.php +++ b/src/Form/Type/EWZRecaptchaType.php @@ -18,10 +18,10 @@ class EWZRecaptchaType extends AbstractEWZRecaptchaType * * @var bool */ - protected bool $ajax; + protected $ajax; /** @var LocaleResolver */ - protected LocaleResolver $localeResolver; + protected $localeResolver; /** * @param string $publicKey Recaptcha public key @@ -66,7 +66,8 @@ public function configureOptions(OptionsResolver $resolver): void } /** - * {@inheritdoc} + * + * @return string */ public function getParent(): string { diff --git a/src/Form/Type/EWZRecaptchaV3Type.php b/src/Form/Type/EWZRecaptchaV3Type.php index 5e9ac4e..fc0107d 100755 --- a/src/Form/Type/EWZRecaptchaV3Type.php +++ b/src/Form/Type/EWZRecaptchaV3Type.php @@ -12,7 +12,7 @@ class EWZRecaptchaV3Type extends AbstractEWZRecaptchaType public const DEFAULT_ACTION_NAME = 'form'; /** @var bool */ - private bool $hideBadge; + private $hideBadge; /** * EWZRecaptchaV3Type constructor. diff --git a/src/Locale/LocaleResolver.php b/src/Locale/LocaleResolver.php index b717458..ede7097 100644 --- a/src/Locale/LocaleResolver.php +++ b/src/Locale/LocaleResolver.php @@ -10,13 +10,13 @@ final class LocaleResolver { /** @var string */ - private string $defaultLocale; + private $defaultLocale; /** @var bool */ - private bool $useLocaleFromRequest; + private $useLocaleFromRequest; /** @var RequestStack */ - private RequestStack $requestStack; + private $requestStack; /** * @param string $defaultLocale diff --git a/src/Validator/Constraints/IsTrue.php b/src/Validator/Constraints/IsTrue.php index bf65221..2a4cb76 100644 --- a/src/Validator/Constraints/IsTrue.php +++ b/src/Validator/Constraints/IsTrue.php @@ -2,13 +2,14 @@ namespace EWZ\Bundle\RecaptchaBundle\Validator\Constraints; +use Attribute; use Symfony\Component\Validator\Constraint; /** * @Annotation * @Target("PROPERTY") */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)] +#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] class IsTrue extends Constraint { public $message = 'This value is not a valid captcha.'; diff --git a/src/Validator/Constraints/IsTrueV3.php b/src/Validator/Constraints/IsTrueV3.php index 5620538..cf17904 100755 --- a/src/Validator/Constraints/IsTrueV3.php +++ b/src/Validator/Constraints/IsTrueV3.php @@ -2,11 +2,13 @@ namespace EWZ\Bundle\RecaptchaBundle\Validator\Constraints; +use Attribute; + /** * @Annotation * @Target("PROPERTY") */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)] +#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] class IsTrueV3 extends IsTrue { /** diff --git a/src/Validator/Constraints/IsTrueValidator.php b/src/Validator/Constraints/IsTrueValidator.php index ce06bcf..e8b4476 100755 --- a/src/Validator/Constraints/IsTrueValidator.php +++ b/src/Validator/Constraints/IsTrueValidator.php @@ -24,14 +24,14 @@ class IsTrueValidator extends ConstraintValidator * * @var ReCaptcha */ - protected ReCaptcha $recaptcha; + protected $recaptcha; /** * Request Stack. * * @var RequestStack */ - protected RequestStack $requestStack; + protected $requestStack; /** * Enable serverside host check. @@ -44,14 +44,14 @@ class IsTrueValidator extends ConstraintValidator * * @var AuthorizationChecker|null */ - protected ?AuthorizationCheckerInterface $authorizationChecker; + protected $authorizationChecker; /** * Trusted Roles. * * @var array */ - protected array $trustedRoles; + protected $trustedRoles; /** * @param bool $enabled diff --git a/src/Validator/Constraints/IsTrueValidatorV3.php b/src/Validator/Constraints/IsTrueValidatorV3.php index bf5bd10..f531fa0 100755 --- a/src/Validator/Constraints/IsTrueValidatorV3.php +++ b/src/Validator/Constraints/IsTrueValidatorV3.php @@ -16,22 +16,22 @@ class IsTrueValidatorV3 extends ConstraintValidator { /** @var bool */ - private bool $enabled; + private $enabled; /** @var string */ - private string $secretKey; + private $secretKey; /** @var float */ - private float $scoreThreshold; + private $scoreThreshold; /** @var ReCaptcha */ - private ReCaptcha $reCaptcha; + private $reCaptcha; /** @var RequestStack */ - private RequestStack $requestStack; + private $requestStack; /** @var LoggerInterface */ - private LoggerInterface $logger; + private $logger; /** * ContainsRecaptchaValidator constructor.