epiphany / date-factory
Simple, mockable, factory for creating dates
Installs: 5 572
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.1|^8.0
Requires (Dev)
- phpspec/phpspec: ^6.2
This package is auto-updated.
Last update: 2025-03-01 00:18:01 UTC
README
#Date Factory
A simple, re-usable DateTime factory that can be injected into services and easily mocked.
Usage:
$dateTimeFactory = new DateTimeFactory();
$now = $dateTimeFactory->now();
$then = $dateTimeFactory->now("yesterday"); // accepts any input to \DateTime::__construct()
var_dump([$now,$then]);