That would be great, thank you. On Fri, Mar 5, 2021 at 12:37 AM Andreas Heigl <andr...@heigl.org> wrote:
> Hey all > > Am 04.03.21 um 13:34 schrieb Chris Seufert: > > Hello, > > > > I would like to propose standardizing a clock interface for reading the > > current time, date, timestamp, and timezone. > > > > The problems I hope to solve is when testing time sensitive code, there > is > > a unified way to represend the current time. I have run into several > issues > > doing this some of which are: > > - Some library use different Clock interfaces / implementations. > > - Its impossible to mock some calls to date and time without using a PHP > > extension to override the current time & date. > > - There are about 10 competing library implentations to this problem > just > > from a quck search on packagist > > > > The proposed interface would look like this: > > > > interface ClockInterface > > { > > public function timestamp():int; > > > > public function immutable():\DateTimeImmutable; > > > > public function datetime():\DateTime > > > > public function microtime():float > > > > public function timezone():\DateTimeZone > > } > > > > I have created a pull request for this here: > > https://github.com/php-fig/fig-standards/pull/1224 > > > > I am looking to find out if anyone is interesting in sponsoring this > > Standard. > > > > I have enjoyed using the PSR-16 interopable caches, and also migrated a > > large legacy application to use PSR-7/PSR-15 and also benefits from > using > > standard middlewares and request extensions, and hope this could provide > a > > similar experience in the future. > > I won't be able to act as sponsor but would be available for a working > group if that is helpful. > > Cheers > > Andreas > -- > ,,, > (o o) > +---------------------------------------------------------ooO-(_)-Ooo-+ > | Andreas Heigl | > | mailto:andr...@heigl.org N 50°22'59.5" E 08°23'58" | > | https://andreas.heigl.org | > +---------------------------------------------------------------------+ > | https://hei.gl/appointmentwithandreas | > +---------------------------------------------------------------------+ > > -- > You received this message because you are subscribed to a topic in the > Google Groups "PHP Framework Interoperability Group" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/php-fig/lA8Lz0E4dWk/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > php-fig+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/php-fig/67a54cec-28bc-e547-6e7f-d6d1c77aa44a%40heigl.org > . > -- Chris Seufert *M.* 0424 066 016 *T.* 03 9510 7477 *The Well* - 1 / 21 Wellington St, St Kilda, Victoria 3182, Australia *modd.com.au <http://modd.com.au/> - udo.net.au <http://udo.net.au/> - artsphere.com.au <http://artsphere.com.au/>* -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAN1g4Syc3%3DrimFT6-7VSbyULtkuWBaRBHdY%2B0841YBGDVnoE_A%40mail.gmail.com.