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

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

This package is not auto-updated.

Last update: 2024-04-27 18:04:25 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