Let's be controversial: In modern #PHP, you should never type-hint an array.
Let's be controversial: In modern #PHP, you should never type-hint an array.
@Crell mostly in my case, I want to retrieve data, transform it into something, maybe do validation on it and then get the data out.
With quick prototyping I end up propping all that data into 1 array, with each step sometimes not knowing if my array should have a different shape (because I want to put "wires" between an object and where the data should go.
@anthonyvdg Deserialize it into a classed object using Crell/Serde, build the validation into that. Using either Serde's callbacks, or property hooks, or something like Symfony/Validator.
Your object completed? Great, it's valid. And now you have an object to use!