stof / StofDoctrineExtensionsBundle

Integration bundle for DoctrineExtensions by l3pp4rd in Symfony
https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/index.html
MIT License
1.89k stars 379 forks source link

[TimeStampable] symfony/clock use instead of new DateTime #469

Closed adapik closed 8 months ago

adapik commented 9 months ago

I would like to have a optional symfony/clock integration with Timestampable, now the DateTime object created with new, so we have no option to mock them in tests.

stof commented 9 months ago

This can only be done in the bundle once the extensions have support for using a PSR-20 clock. Otherwise, there is no way for the bundle to configure it to use it. So you should request that to the extensions first.

mbabker commented 8 months ago

As of the package's 3.15 release, a clock can be injected. See https://github.com/doctrine-extensions/DoctrineExtensions/pull/2760 for reference.

adapik commented 8 months ago

Thank you, @stof