Skip to content

Commit

Permalink
Fix setting of message via field's constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jansramek authored and f3l1x committed Jun 15, 2020
1 parent 0f42927 commit 0d81d8d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Forms/InvisibleReCaptchaBinding.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ final class InvisibleReCaptchaBinding
public static function bind(ReCaptchaProvider $provider, string $name = 'addInvisibleReCaptcha'): void
{
// Bind to form container

Container::extensionMethod($name, function (Container $container, string $name = 'recaptcha', bool $required = true) use ($provider): InvisibleReCaptchaField {
$field = new InvisibleReCaptchaField($provider);
Container::extensionMethod($name, function (Container $container, string $name = 'recaptcha', bool $required = true, ?string $message = null) use ($provider): InvisibleReCaptchaField {
$field = new InvisibleReCaptchaField($provider, $message);
$field->setRequired($required);
$container[$name] = $field;

Expand Down

0 comments on commit 0d81d8d

Please sign in to comment.