Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This method expects the second parameter to be a string error message, while callable is passed at the third parameter. Original code reference: https://github.com/cakephp/cakephp/blob/master/src/Validation/Validator.php#L850-L866 ``` /** * Allows a field to be an empty string. * * This method is equivalent to calling allowEmptyFor() with EMPTY_STRING flag. * * @param string $field The name of the field. * @param string|null $message The message to show if the field is not * @param bool|string|callable $when Indicates when the field is allowed to be empty * Valid values are true, false, 'create', 'update'. If a callable is passed then * the field will allowed to be empty only when the callback returns true. * @return $this * @see \Cake\Validation\Validator::allowEmptyFor() For detail usage */ public function allowEmptyString(string $field, ?string $message = null, $when = true) { return $this->allowEmptyFor($field, self::EMPTY_STRING, $when, $message); }```
- Loading branch information