koriym/now

This package is abandoned and no longer maintained. The author suggests using the ray/indentify-value-module package instead.

Pprovides current time

1.0.0 2016-01-26 08:28 UTC

README

Build Status Scrutinizer Code Quality Code Coverage

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);
}