I know a tuple isn't a PHP structure, but you can still format and validate your data like it is. For instance, I want to validate a list of tuples:
[
[date, date, [ints], int],
[date, date, [ints], int],
[date, date, [ints], int],
// etc, 20 or 100 more lines, so I don't want assoc arrays (Expect::structure())
]
The outside would be a listOf(), but a list of what? Tuples. Numeric arrays with a set amount of items that have specific types: elements 0 and 1 are dates, element 2 is a listOf(int()), element 3 is an int().
I know a tuple isn't a PHP structure, but you can still format and validate your data like it is. For instance, I want to validate a list of tuples:
The outside would be a
listOf()
, but a list of what? Tuples. Numeric arrays with a set amount of items that have specific types: elements 0 and 1 are dates, element 2 is alistOf(int())
, element 3 is anint()
.Maybe something like