When we now try to construct a data object like this:
SongData::from(['title'=>'Never gonna give you up','artist'=>'Rick Astley','date'=>'27-07-1987','format'=>'vinyl',]);
And get an error because the first two properties are simple PHP types(string, int's, floats, booleans, arrays), but the following two properties are more complex types: DateTime and Enum, respectively.
These types cannot be automatically created. A cast is needed to construct them from a string.
There are two types of casts, local and global casts.