@@ -31,12 +31,12 @@ class ConstraintViolation implements ConstraintViolationInterface
31
31
/**
32
32
* @var array
33
33
*/
34
- private $ messageParameters ;
34
+ private $ parameters ;
35
35
36
36
/**
37
37
* @var integer|null
38
38
*/
39
- private $ messagePluralization ;
39
+ private $ plural ;
40
40
41
41
/**
42
42
* @var mixed
@@ -61,27 +61,26 @@ class ConstraintViolation implements ConstraintViolationInterface
61
61
/**
62
62
* Creates a new constraint violation.
63
63
*
64
- * @param string $message The violation message.
65
- * @param string $messageTemplate The raw violation message.
66
- * @param array $messageParameters The parameters to substitute
67
- * in the raw message.
68
- * @param mixed $root The value originally passed
69
- * to the validator.
70
- * @param string $propertyPath The property path from the
71
- * root value to the invalid
72
- * value.
73
- * @param mixed $invalidValue The invalid value causing the
74
- * violation.
75
- * @param integer|null $messagePluralization The pluralization parameter.
76
- * @param mixed $code The error code of the
77
- * violation, if any.
78
- */
79
- public function __construct ($ message , $ messageTemplate , array $ messageParameters , $ root , $ propertyPath , $ invalidValue , $ messagePluralization = null , $ code = null )
64
+ * @param string $message The violation message
65
+ * @param string $messageTemplate The raw violation message
66
+ * @param array $parameters The parameters to substitute in the
67
+ * raw violation message
68
+ * @param mixed $root The value originally passed to the
69
+ * validator
70
+ * @param string $propertyPath The property path from the root
71
+ * value to the invalid value
72
+ * @param mixed $invalidValue The invalid value that caused this
73
+ * violation
74
+ * @param integer|null $plural The number for determining the plural
75
+ * form when translation the message
76
+ * @param mixed $code The error code of the violation
77
+ */
78
+ public function __construct ($ message , $ messageTemplate , array $ parameters , $ root , $ propertyPath , $ invalidValue , $ plural = null , $ code = null )
80
79
{
81
80
$ this ->message = $ message ;
82
81
$ this ->messageTemplate = $ messageTemplate ;
83
- $ this ->messageParameters = $ messageParameters ;
84
- $ this ->messagePluralization = $ messagePluralization ;
82
+ $ this ->parameters = $ parameters ;
83
+ $ this ->plural = $ plural ;
85
84
$ this ->root = $ root ;
86
85
$ this ->propertyPath = $ propertyPath ;
87
86
$ this ->invalidValue = $ invalidValue ;
@@ -130,15 +129,31 @@ public function getMessageTemplate()
130
129
*/
131
130
public function getMessageParameters ()
132
131
{
133
- return $ this ->messageParameters ;
132
+ return $ this ->parameters ;
133
+ }
134
+
135
+ /**
136
+ * Alias of {@link getMessageParameters()}.
137
+ */
138
+ public function getParameters ()
139
+ {
140
+ return $ this ->parameters ;
134
141
}
135
142
136
143
/**
137
144
* {@inheritDoc}
138
145
*/
139
146
public function getMessagePluralization ()
140
147
{
141
- return $ this ->messagePluralization ;
148
+ return $ this ->plural ;
149
+ }
150
+
151
+ /**
152
+ * Alias of {@link getMessagePluralization()}.
153
+ */
154
+ public function getPlural ()
155
+ {
156
+ return $ this ->plural ;
142
157
}
143
158
144
159
/**
0 commit comments