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
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
-
}
30
+
if (\func_num_args() >1) {
31
+
@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);
32
+
33
+
$expressionLanguage =func_get_arg(1);
34
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);
37
-
$expressionLanguage =func_get_arg(1);
35
+
if (!$expressionLanguageinstanceof ExpressionLanguage) {
36
+
thrownew \TypeError(sprintf('Argument 2 passed to %s() must be an instance of %s, %s given.',__METHOD__, ExpressionLanguage::class,\is_object($expressionLanguage) ?\get_class($expressionLanguage) :\gettype($expressionLanguage)));
@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);
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -272,7 +272,7 @@ public function testExpressionLanguageUsage()
272
272
$this->assertTrue($used,'Failed asserting that custom ExpressionLanguage instance is used.');
273
273
}
274
274
275
-
/**
275
+
/*
276
276
* @group legacy
277
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.