A php 7 class that can return the current time as well as an interface, that can be mocked for unit tests.

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/tueena-lib/now

v1.0.1 2017-01-08 00:18 UTC

This package is not auto-updated.

Last update: 2025-10-12 01:31:40 UTC


README

A php 7 class that returns the current time as well as an interface, that can be mocked for unit tests.

Features

  • Invoking an instance of the class returns an instance of \DateTimeImmutable.

Usage

<?php

use tueenaLib\now;

$now = new Now;
$immutableDateTimeObject = $now();

License

MIT

Requirements

php >= 7.0.0

Installation

If you use Composer:

composer require tueena-lib/now

Otherwise just download the class and the interface and use it.

Contact

Bastian Fenske bastian.fenske@tueena.org