@@ -41,14 +41,11 @@ class Validator extends BaseConstraint
41
41
*
42
42
* @param mixed $value
43
43
* @param mixed $schema
44
- * @param int $checkMode
45
- *
46
- * @return int
47
44
*
48
45
* @phpstan-param int-mask-of<Constraint::CHECK_MODE_*> $checkMode
49
46
* @phpstan-return int-mask-of<Validator::ERROR_*>
50
47
*/
51
- public function validate (&$ value , $ schema = null , $ checkMode = null )
48
+ public function validate (&$ value , $ schema = null , int $ checkMode = null ): int
52
49
{
53
50
// reset errors prior to validation
54
51
$ this ->reset ();
@@ -82,19 +79,29 @@ public function validate(&$value, $schema = null, $checkMode = null)
82
79
/**
83
80
* Alias to validate(), to maintain backwards-compatibility with the previous API
84
81
*
85
- * @deprecated
82
+ * @deprecated since 6.0.0, use Validator::validate() instead, to be removed in 7.0
83
+ *
84
+ * @param mixed $value
85
+ * @param mixed $schema
86
+ *
87
+ * @phpstan-return int-mask-of<Validator::ERROR_*>
86
88
*/
87
- public function check ($ value , $ schema )
89
+ public function check ($ value , $ schema ): int
88
90
{
89
91
return $ this ->validate ($ value , $ schema );
90
92
}
91
93
92
94
/**
93
95
* Alias to validate(), to maintain backwards-compatibility with the previous API
94
96
*
95
- * @deprecated
97
+ * @deprecated since 6.0.0, use Validator::validate() instead, to be removed in 7.0
98
+ *
99
+ * @param mixed $value
100
+ * @param mixed $schema
101
+ *
102
+ * @phpstan-return int-mask-of<Validator::ERROR_*>
96
103
*/
97
- public function coerce (&$ value , $ schema )
104
+ public function coerce (&$ value , $ schema ): int
98
105
{
99
106
return $ this ->validate ($ value , $ schema , Constraint::CHECK_MODE_COERCE_TYPES );
100
107
}
0 commit comments