[DEPRECATED] use ray/indentify-value-module (https://github.com/ray-di/Ray.IdentityValueModule) instead
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.gitignore
.php_cs
.scrutinizer.yml
.travis.yml
LICENSE
README.md
build.xml
composer.json
phpcs.xml
phpmd.xml
phpunit.xml.dist

README.md

Koriym.Now

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