Time utility class

v1.0.1 2020-07-20 10:14 UTC

This package is not auto-updated.

Last update: 2024-04-24 02:49:01 UTC


README

Utility class which encapsulates \time() and allows freeze/unfreeze time.

How to use

Install by composer require amberovsky/time

$time = new Amberovsky\Time\Time();

$time->getTimestamp(); // current timestamp
$time->freeze(1);
$time->getTimestamp(); // == 1
$time->unfreeze();
$time->getTimestamp(); // current timestamp

How to contribute

Please fork this repo and create a PR. Make sure you run tests before submitting yout PR:

make phpstan
make psalm
make phpspec

License

Copyright (C) 2020 Anton Zagorskii, BSD-3-Clause license, See license file for details