-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
These form types should support a way to use the DateTimeImmutable class of PHP 5.5 (only on PHP 5.5+ obviously) for applications using it.
This involves accepting them as input and returning an immutable datetime as model data after the transformation.
The easiest implementation is probably to add a new value for the input
option and add a transformer converting the immutable date into a mutable one (so that the norm data stays a DateTime class).
If a new major version of Symfony bumps the requirement to PHP 5.5+, the normalized data could then be switched to the DateTimeImmutable class to simplify the logic (which is currently cloning the DateTime to avoid modifying the original one.
webdevilopers, davidkmenta, JarekW, afoeder and yceruto