-
Notifications
You must be signed in to change notification settings - Fork 165
Feature symfony7 update #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
46e9fa1
3c14fc6
fc471cb
7d77548
910e381
b506d33
5e182f3
feed3f2
957f6c6
59a9b87
c75f4ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
phpunit.xml | ||
vendor/ | ||
composer.lock | ||
/nbproject/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,4 @@ | |
"allow-contrib": "true" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,28 +13,28 @@ abstract class AbstractEWZRecaptchaType extends AbstractType | |
* | ||
* @var string | ||
*/ | ||
protected $publicKey; | ||
protected string $publicKey; | ||
|
||
/** | ||
* Enable recaptcha? | ||
* | ||
* @var bool | ||
*/ | ||
protected $enabled; | ||
protected bool $enabled; | ||
|
||
/** | ||
* The API server host name. | ||
* | ||
* @var string | ||
*/ | ||
protected $apiHost; | ||
protected string $apiHost; | ||
|
||
/** | ||
* The reCAPTCHA server URL. | ||
* | ||
* @var string | ||
*/ | ||
protected $recaptchaApiServer; | ||
protected string $recaptchaApiServer; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please removes all property types from that class |
||
|
||
/** | ||
* @param string $publicKey Recaptcha public key | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,19 +8,19 @@ | |
|
||
<script> | ||
var onReCaptchaSuccess = function() { | ||
var errorDivs = document.getElementsByClassName('recaptcha-error'); | ||
const errorDivs = document.getElementsByClassName('recaptcha-error'); | ||
if (errorDivs.length) { | ||
errorDivs[0].className = ''; | ||
} | ||
var errorMsgs = document.getElementsByClassName('recaptcha-error-message'); | ||
const errorMsgs = document.getElementsByClassName('recaptcha-error-message'); | ||
if (errorMsgs.length) { | ||
errorMsgs[0].parentNode.removeChild(errorMsgs[0]); | ||
} | ||
var forms = document.getElementsByClassName('recaptcha-form'); | ||
const forms = document.getElementsByClassName('recaptcha-form'); | ||
if (forms.length) { | ||
var recaptchaSubmitEvent = document.createEvent('Event'); | ||
let recaptchaSubmitEvent = document.createEvent('Event'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unrelated to Symfony 7 |
||
recaptchaSubmitEvent.initEvent('submit', true, true); | ||
forms[0].addEventListener('submit', function (e) { | ||
e.target.submit(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.'; | ||
|
@@ -26,7 +27,7 @@ public function __construct(array $options = null, string $message = null, strin | |
/** | ||
* @return string|string[] | ||
*/ | ||
public function getTargets() | ||
public function getTargets(): array|string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Union Type is not supported by PHP 7.x, please remove it |
||
{ | ||
return Constraint::PROPERTY_CONSTRAINT; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Union types to remove