Skip to content

Commit

Permalink
Removed all class attributes due for legacy compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
snipershady committed Dec 29, 2023
1 parent feed3f2 commit 957f6c6
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 26 deletions.
6 changes: 3 additions & 3 deletions src/Extension/ReCaptcha/RequestMethod/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/Extension/ReCaptcha/RequestMethod/ProxyPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions src/Form/Type/EWZRecaptchaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -66,7 +66,8 @@ public function configureOptions(OptionsResolver $resolver): void
}

/**
* {@inheritdoc}
*
* @return string
*/
public function getParent(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/EWZRecaptchaV3Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class EWZRecaptchaV3Type extends AbstractEWZRecaptchaType
public const DEFAULT_ACTION_NAME = 'form';

/** @var bool */
private bool $hideBadge;
private $hideBadge;

/**
* EWZRecaptchaV3Type constructor.
Expand Down
6 changes: 3 additions & 3 deletions src/Locale/LocaleResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Validator/Constraints/IsTrue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
Expand Down
4 changes: 3 additions & 1 deletion src/Validator/Constraints/IsTrueV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
8 changes: 4 additions & 4 deletions src/Validator/Constraints/IsTrueValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/Validator/Constraints/IsTrueValidatorV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 957f6c6

Please sign in to comment.