X-Git-Url: https://git.rapsys.eu/packbundle/blobdiff_plain/1e261bd3495a7b730972d5a903de6b2ecc9cc1e8..cc594246ad5d0bef91ff3b83ce9de7206acd61ec:/Form/CaptchaType.php diff --git a/Form/CaptchaType.php b/Form/CaptchaType.php index d479b47..c0d5ae1 100644 --- a/Form/CaptchaType.php +++ b/Form/CaptchaType.php @@ -29,21 +29,6 @@ use Symfony\Component\Form\FormError; * @see https://symfony.com/doc/current/form/create_custom_field_type.html */ class CaptchaType extends AbstractType { - /** - * @var ImageUtil $image - */ - private $image; - - /** - * @var SluggerUtil $slugger - */ - private $slugger; - - /** - * @var Translator instance - */ - private $translator; - /** * Constructor * @@ -51,15 +36,7 @@ class CaptchaType extends AbstractType { * @param SluggerUtil $slugger * @param TranslatorInterface $translator The translator instance */ - public function __construct(ImageUtil $image, SluggerUtil $slugger, TranslatorInterface $translator) { - //Set image - $this->image = $image; - - //Set slugger - $this->slugger = $slugger; - - //Set translator - $this->translator = $translator; + public function __construct(protected ImageUtil $image, protected SluggerUtil $slugger, protected TranslatorInterface $translator) { } /** @@ -67,7 +44,7 @@ class CaptchaType extends AbstractType { * * {@inheritdoc} */ - public function buildForm(FormBuilderInterface $builder, array $options) { + public function buildForm(FormBuilderInterface $builder, array $options): void { //Set captcha $captcha = $this->image->getCaptcha((new \DateTime('-1 year'))->getTimestamp());