1 | <?php |
||
18 | abstract class AbstractValidator |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * @var mixed The value to evaluate |
||
23 | */ |
||
24 | protected $value; |
||
25 | |||
26 | /** |
||
27 | * @readwrite |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $message = ''; |
||
31 | |||
32 | /** |
||
33 | * @var array Error messages templates |
||
34 | */ |
||
35 | protected $messageTemplate = ''; |
||
36 | |||
37 | /** |
||
38 | * Returns an array of messages that explain why the most recent |
||
39 | * isValid() call returned false. The array keys are validation failure |
||
40 | * message identifiers, and the array values are the corresponding |
||
41 | * human-readable message strings. |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 22 | public function getMessage() |
|
49 | |||
50 | /** |
||
51 | * Sets a custom message for a given identifier |
||
52 | * |
||
53 | * @param string $message |
||
54 | * |
||
55 | * @return AbstractValidator |
||
56 | */ |
||
57 | 4 | public function setMessage($message) |
|
62 | |||
63 | /** |
||
64 | * Adds a message using a template. |
||
65 | * |
||
66 | * @param string $template Message template. |
||
67 | * |
||
68 | * @return AbstractValidator |
||
69 | */ |
||
70 | 34 | protected function addMessage($template) |
|
83 | |||
84 | } |
||
85 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..