Problem
date_span() currently type-hints DateTime.
That excludes DateTimeImmutable, even though immutable date objects are common in modern Symfony applications.
Current evidence
src/Twig/Extension/DateSpanExtension.php accepts DateTime $dateTime
- the helper logic only needs a standard PHP date-time interface, not the mutable implementation specifically
Expected behavior
The filter should work with standard PHP date objects, including DateTimeImmutable.
Suggested work
- change the accepted type to
DateTimeInterface
- add tests covering immutable date instances
- update documentation and feature definitions so the supported input types are explicit
Problem
date_span()currently type-hintsDateTime.That excludes
DateTimeImmutable, even though immutable date objects are common in modern Symfony applications.Current evidence
src/Twig/Extension/DateSpanExtension.phpacceptsDateTime $dateTimeExpected behavior
The filter should work with standard PHP date objects, including
DateTimeImmutable.Suggested work
DateTimeInterface