* @param ?ImageUtil $image The image instance
* @param ?SluggerUtil $slugger The slugger instance
* @param ?TranslatorInterface $translator The translator instance
+ * @param bool $enable Use captcha
*/
- public function __construct(protected ?ImageUtil $image = null, protected ?SluggerUtil $slugger = null, protected ?TranslatorInterface $translator = null) {
+ public function __construct(protected ?ImageUtil $image = null, protected ?SluggerUtil $slugger = null, protected ?TranslatorInterface $translator = null, protected bool $enable = false) {
}
/**
parent::configureOptions($resolver);
//Set defaults
- $resolver->setDefaults(['captcha' => false, 'error_bubbling' => true, 'translation_domain' => RapsysPackBundle::getAlias()]);
+ $resolver->setDefaults(['captcha' => $this->enable, 'error_bubbling' => true, 'translation_domain' => RapsysPackBundle::getAlias()]);
//Add extra captcha option
$resolver->setAllowedTypes('captcha', 'boolean');