for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\ODM\MongoDB\Types;
use DateTime;
use DateTimeImmutable;
use DateTimeInterface;
class DateImmutableType extends DateType
{
public static function getDateTime($value) : DateTimeInterface
$datetime = parent::getDateTime($value);
return $datetime instanceof DateTime ? DateTimeImmutable::createFromMutable($datetime) : $datetime;
}