You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ CHANGELOG
4
4
4.4.0
5
5
-----
6
6
7
+
* deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()`. Pass it as the first argument instead.
7
8
* added the `compared_value_path` parameter in violations when using any
8
9
comparison constraint with the `propertyPath` option.
9
10
* added support for checking an array of types in `TypeValidator`
if (!$expressionLanguageinstanceof ExpressionLanguage) {
31
+
if (null !== $expressionLanguage) {
32
+
@trigger_error(sprintf('The "%s" first argument must be an instance of "%s" or null since 4.4. "%s" given', __METHOD__, ExpressionLanguage::class, \is_object($expressionLanguage) ? \get_class($expressionLanguage) : \gettype($expressionLanguage)), E_USER_DEPRECATED);
33
+
}
34
+
35
+
if (\func_num_args() > 1 && func_get_arg(1) instanceof ExpressionLanguage) {
36
+
@trigger_error(sprintf('The "%s" instance should be passed as "%s" first argument instead of second argument since 4.4.', ExpressionLanguage::class, __METHOD__), E_USER_DEPRECATED);
$this->assertTrue($used, 'Failed asserting that custom ExpressionLanguage instance is used.');
273
+
}
274
+
275
+
/**
276
+
* @group legacy
277
+
* @expectedDeprecation The "Symfony\Component\ExpressionLanguage\ExpressionLanguage" instance should be passed as "Symfony\Component\Validator\Constraints\ExpressionValidator::__construct" first argument instead of second argument since 4.4.
@@ -271,6 +300,15 @@ public function testExpressionLanguageUsage()
271
300
$this->assertTrue($used, 'Failed asserting that custom ExpressionLanguage instance is used.');
272
301
}
273
302
303
+
/**
304
+
* @group legacy
305
+
* @expectedDeprecation The "Symfony\Component\Validator\Constraints\ExpressionValidator::__construct" first argument must be an instance of "Symfony\Component\ExpressionLanguage\ExpressionLanguage" or null since 4.4. "string" given
0 commit comments