diff --git a/reference/constraints/When.rst b/reference/constraints/When.rst
index acd35cddcf5..ed855857b1d 100644
--- a/reference/constraints/When.rst
+++ b/reference/constraints/When.rst
@@ -69,7 +69,7 @@ One way to accomplish this is with the When constraint:
{
#[Assert\GreaterThan(0)]
#[Assert\When(
- expression: 'this.type == "percent"',
+ expression: 'this.getType() == "percent"',
constraints: [
new Assert\LessThanOrEqual(100, message: 'The value should be between 1 and 100!')
],
@@ -87,7 +87,7 @@ One way to accomplish this is with the When constraint:
value:
- GreaterThan: 0
- When:
- expression: "this.type == 'percent'"
+ expression: "this.getType() == 'percent'"
constraints:
- LessThanOrEqual:
value: 100
@@ -105,7 +105,7 @@ One way to accomplish this is with the When constraint:
0