Download the PHP package olajoscs/dateprovider without Composer
On this page you can find all versions of the php package olajoscs/dateprovider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download olajoscs/dateprovider
More information about olajoscs/dateprovider
Files in olajoscs/dateprovider
Download olajoscs/dateprovider
More information about olajoscs/dateprovider
Files in olajoscs/dateprovider
Vendor olajoscs
Package dateprovider
Short Description A simple DateTimeImmutable provider to replace or simulate the "new DateTimeImmutable"
License MIT
Package dateprovider
Short Description A simple DateTimeImmutable provider to replace or simulate the "new DateTimeImmutable"
License MIT
Please rate this library. Is it a good library?
Informations about the package dateprovider
DateProvider
A simple library to replace new \DateTime
or new \DateTimImmutable
in your code.
Why?
Testing is hard when you have hidden dependencies. Getting the current time is one of them, as it is always changing.
How to use
Classes should depend on the DateProvider
interface.
There are 2 implementations in the library:
CurrentDateProvider
: returns the current date/time, just likenew \DateTimeImmutable
, your DI container should instantiate this oneExactDateProvider
: returns an exact date/time, which can be used to simulate time pass, useful when writing tests.
All versions of dateprovider with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.0|^8.0
The package olajoscs/dateprovider contains the following files
Loading the files please wait ....