amberovsky / time
Time utility class
v1.0.1
2020-07-20 10:14 UTC
Requires
- php: ^7.4
Requires (Dev)
- phpspec/phpspec: ^6.2
- phpstan/phpstan: ^0.12
- vimeo/psalm: ^3.12
This package is not auto-updated.
Last update: 2025-03-12 07:13:53 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