koriym / now
Pprovides current time
Installs: 7 426
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires (Dev)
- ray/di: ~2.2
README
Provide current time with NowInterface
Usage
use namespace Koriym\Now\Now; use namespace Koriym\Now\FakeNow; $now = new Now; (string) $now // 2015-11-09 01:00:00 $fakeNow = new FakeNow; (string) $fakeNow // 1970-01-01 00:00:00 = FakeNow::Time
For Ray.Di
use namespace Koriym\Now\NowInterface; public function configure() { // prod $this->bind(NowInterface::class)->to(Now::class); // develop $this->bind(NowInterface::class)->to(FakeNow::class); }