File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ abstract class Rule
21
21
/** @var array */
22
22
protected $ params = [];
23
23
24
+ /** @var array */
25
+ protected $ paramsTexts = [];
26
+
24
27
/** @var array */
25
28
protected $ fillableParams = [];
26
29
@@ -145,6 +148,28 @@ public function parameter(string $key)
145
148
return isset ($ this ->params [$ key ])? $ this ->params [$ key ] : null ;
146
149
}
147
150
151
+ /**
152
+ * Set parameter text that can be displayed in error message using ':param_key'
153
+ *
154
+ * @param string $key
155
+ * @param string $text
156
+ * @return void
157
+ */
158
+ public function setParameterText (string $ key , string $ text )
159
+ {
160
+ $ this ->paramsTexts [$ key ] = $ text ;
161
+ }
162
+
163
+ /**
164
+ * Get $paramsTexts
165
+ *
166
+ * @return array
167
+ */
168
+ public function getParametersTexts (): array
169
+ {
170
+ return $ this ->paramsTexts ;
171
+ }
172
+
148
173
/**
149
174
* Check whether this rule is implicit
150
175
*
You can’t perform that action at this time.
0 commit comments