Skip to content

Validation for empty array fields doesn't seem to work #315

@ocean90

Description

@ocean90

Example:

$data = [
	'array_data_required' => [],
	'array_data_size_one' => [],
];

$is_valid = GUMP::is_valid(
	$data,
	[
		'array_data_required' => 'required',
		'array_data_size_one' => 'valid_array_size_equal,1',
	]
);

var_dump( $is_valid ); // bool(true)

In the above example I'd expect that the result is not valid for both fields since their value is empty. Am I'm missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions