@@ -95,7 +95,7 @@ public function setValidator(string $name, callable $callback, string $message =
9595 *
9696 * @return null|callable
9797 */
98- public function getValidator (string $ name )
98+ public function getValidator (string $ name ): ? callable
9999 {
100100 return $ this ->_validators [$ name ] ?? null ;
101101 }
@@ -115,7 +115,7 @@ public function hasValidator(string $name): bool
115115 *
116116 * @return $this
117117 */
118- public function addValidators (array $ validators )
118+ public function addValidators (array $ validators ): self
119119 {
120120 foreach ($ validators as $ name => $ validator ) {
121121 $ this ->addValidator ($ name , $ validator );
@@ -134,7 +134,7 @@ public function getValidators(): array
134134 /**
135135 * @param string $name
136136 */
137- public function delValidator (string $ name )
137+ public function delValidator (string $ name ): void
138138 {
139139 if (isset ($ this ->_validators [$ name ])) {
140140 unset($ this ->_validators [$ name ]);
@@ -144,7 +144,7 @@ public function delValidator(string $name)
144144 /**
145145 * clear validators
146146 */
147- public function clearValidators ()
147+ public function clearValidators (): void
148148 {
149149 $ this ->_validators = [];
150150 }
@@ -194,7 +194,7 @@ public function required(string $field, $value = null): bool
194194 * - FALSE check failed
195195 * - NULL skip check the field
196196 */
197- public function requiredIf (string $ field , $ fieldVal , string $ anotherField , $ values )
197+ public function requiredIf (string $ field , $ fieldVal , string $ anotherField , $ values ): ? bool
198198 {
199199 if (isset ($ this ->data [$ anotherField ])) {
200200 $ anotherVal = $ this ->data [$ anotherField ];
@@ -218,7 +218,7 @@ public function requiredIf(string $field, $fieldVal, string $anotherField, $valu
218218 * @return bool|null
219219 * @see requiredIf()
220220 */
221- public function requiredUnless (string $ field , $ fieldVal , string $ anotherField , $ values )
221+ public function requiredUnless (string $ field , $ fieldVal , string $ anotherField , $ values ): ? bool
222222 {
223223 if (isset ($ this ->data [$ anotherField ])) {
224224 $ anotherVal = $ this ->data [$ anotherField ];
@@ -241,7 +241,7 @@ public function requiredUnless(string $field, $fieldVal, string $anotherField, $
241241 * @return bool|null
242242 * @see requiredIf()
243243 */
244- public function requiredWith (string $ field , $ fieldVal , $ fields )
244+ public function requiredWith (string $ field , $ fieldVal , $ fields ): ? bool
245245 {
246246 foreach ((array )$ fields as $ name ) {
247247 if ($ this ->required ($ name )) {
@@ -262,7 +262,7 @@ public function requiredWith(string $field, $fieldVal, $fields)
262262 * @return bool|null
263263 * @see requiredIf()
264264 */
265- public function requiredWithAll (string $ field , $ fieldVal , $ fields )
265+ public function requiredWithAll (string $ field , $ fieldVal , $ fields ): ? bool
266266 {
267267 $ allHasValue = true ;
268268
@@ -286,7 +286,7 @@ public function requiredWithAll(string $field, $fieldVal, $fields)
286286 * @return bool|null
287287 * @see requiredIf()
288288 */
289- public function requiredWithout (string $ field , $ fieldVal , $ fields )
289+ public function requiredWithout (string $ field , $ fieldVal , $ fields ): ? bool
290290 {
291291 $ allHasValue = true ;
292292
@@ -310,7 +310,7 @@ public function requiredWithout(string $field, $fieldVal, $fields)
310310 * @return bool|null
311311 * @see requiredIf()
312312 */
313- public function requiredWithoutAll (string $ field , $ fieldVal , $ fields )
313+ public function requiredWithoutAll (string $ field , $ fieldVal , $ fields ): ? bool
314314 {
315315 $ allNoValue = true ;
316316
@@ -446,7 +446,7 @@ public function mimeTypesValidator(string $field, $types): bool
446446 *
447447 * @todo
448448 */
449- public function mimesValidator (string $ field , $ types = null )
449+ public function mimesValidator (string $ field , $ types = null ): void
450450 {
451451 }
452452
@@ -588,7 +588,7 @@ public function inFieldValidator($val, string $anotherField): bool
588588 *
589589 * @todo
590590 */
591- public function intervalDayValidator ($ val , string $ compareField , int $ expected , string $ op = '>= ' )
591+ public function intervalDayValidator ($ val , string $ compareField , int $ expected , string $ op = '>= ' ): void
592592 {
593593
594594 }
@@ -677,7 +677,7 @@ public static function isCheckRequired(string $name): bool
677677 *
678678 * @return array|null
679679 */
680- public function getUploadedFile (string $ field )
680+ public function getUploadedFile (string $ field ): ? array
681681 {
682682 return $ this ->uploadedFiles [$ field ] ?? null ;
683683 }
0 commit comments