navarr/precise-clocks

An implementation of PSR-20 that is precise within given confines

Fund package maintenance!
navarr

v1.0.0 2022-11-26 19:04 UTC

This package is auto-updated.

Last update: 2024-11-26 23:51:44 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License
Tests Code Coverage Mutation score

This library contains implementations of PSR-20 that provides a clocks that are precise to their namesake, and while in the same time to that precision, return the exact same object.

Installation

composer require navarr/precise-clocks:^1

Usage

use Navarr\PreciseClock\MinutePrecisionClock;

$clock = new MinutePrecisionClock();
$a = $clock->now();
$b = $clock->now();

spl_object_id($a) === spl_object_id($b); // true