Skip to content

Commit 486b367

Browse files
committed
minor #14543 [Validator] Fix ExpressionLanguageSyntax example (wkania)
This PR was merged into the 5.1 branch. Discussion ---------- [Validator] Fix ExpressionLanguageSyntax example <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Commits ------- b781296 [Validator] Fix ExpressionLanguageSyntax example
2 parents 68525be + b781296 commit 486b367

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

reference/constraints/ExpressionLanguageSyntax.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ The following constraints ensure that:
4040
class Order
4141
{
4242
/**
43-
* @Assert\ExpressionLanguageSyntax()
43+
* @Assert\ExpressionLanguageSyntax
4444
*/
4545
protected $promotion;
4646
4747
/**
4848
* @Assert\ExpressionLanguageSyntax(
49-
* allowedVariables = ['user', 'shipping_centers']
49+
* allowedVariables={"user", "shipping_centers"}
5050
* )
5151
*/
5252
protected $shippingOptions;
@@ -77,7 +77,10 @@ The following constraints ensure that:
7777
</property>
7878
<property name="shippingOptions">
7979
<constraint name="ExpressionLanguageSyntax">
80-
<option name="allowedVariables">['user', 'shipping_centers']</option>
80+
<option name="allowedVariables">
81+
<value>user</value>
82+
<value>shipping_centers</value>
83+
</option>
8184
</constraint>
8285
</property>
8386
</class>

0 commit comments

Comments
 (0)