Like '', an empty array is not an acceptable empty state for a file upload field. The `[]` value should be passed onto other validator rules as it is likely not valid.
@@ -2339,7 +2339,7 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
return true;
}
- $arrayTypes = self::EMPTY_ARRAY | self::EMPTY_DATE | self::EMPTY_TIME | self::EMPTY_FILE;
+ $arrayTypes = self::EMPTY_ARRAY | self::EMPTY_DATE | self::EMPTY_TIME;
if ($data === [] && ($flags & $arrayTypes)) {
@@ -913,7 +913,7 @@ class ValidatorTest extends TestCase
$data = ['photo' => []];
$result = $validator->errors($data);
- $this->assertEmpty($result);
+ $this->assertSame($expected, $result);
$validator = new Validator();
$validator->allowEmptyArray('photo', 'update', 'message');