Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d125c92

Browse filesBrowse files
committed
Add test groups and change deprecation message + trigger
1 parent 10218cf commit d125c92
Copy full SHA for d125c92

File tree

Expand file treeCollapse file tree

2 files changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-2
lines changed

‎src/Symfony/Component/Validator/Constraints/ExpressionLanguageSyntax.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/ExpressionLanguageSyntax.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public function __construct(array $options = null, string $message = null, strin
4242
$this->allowedVariables = $allowedVariables ?? $this->allowedVariables;
4343
$this->allowNullAndEmptyString = $allowNullAndEmptyString ?? $this->allowNullAndEmptyString;
4444

45-
if (isset($options['allowNullAndEmptyString'])) {
46-
trigger_deprecation('symfony/validator', '5.4', sprintf('The "allowNullAndEmptyString" option of the "%s" constraint is deprecated.', self::class));
45+
if (!$this->allowNullAndEmptyString) {
46+
trigger_deprecation('symfony/validator', '5.4', 'Not setting "allowNullAndEmptyString" of the "%s" constraint to "true" is deprecated.', __CLASS__);
4747
}
4848
}
4949

‎src/Symfony/Component/Validator/Tests/Constraints/ExpressionLanguageSyntaxValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Constraints/ExpressionLanguageSyntaxValidatorTest.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public function testNullIsValid()
7575
$this->assertNoViolation();
7676
}
7777

78+
/**
79+
* @group legacy
80+
*/
7881
public function testNullWithoutAllowOptionIsNotValid()
7982
{
8083
$this->expectExceptionMessage('Expected argument of type "string", "null" given');
@@ -91,6 +94,9 @@ public function testEmptyStringIsValid()
9194
$this->assertNoViolation();
9295
}
9396

97+
/**
98+
* @group legacy
99+
*/
94100
public function testEmptyStringWithoutAllowOptionIsNotValid()
95101
{
96102
$this->validator->validate('', new ExpressionLanguageSyntax());

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.