PHPackages                             stella-maris/clock - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. stella-maris/clock

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

stella-maris/clock
==================

A pre-release of the proposed PSR-20 Clock-Interface

0.1.7(3y ago)7947.5M—2.8%1[1 PRs](https://github.com/stella-maris-solutions/clock/pulls)2MITPHPPHP ^7.0|^8.0

Since Apr 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/stella-maris-solutions/clock)[ Packagist](https://packagist.org/packages/stella-maris/clock)[ Docs](https://gitlab.com/stella-maris/clock)[ RSS](/packages/stella-maris-clock/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (11)Used By (2)

Clock
=====

[](#clock)

An implementation of the proposed PSR-20 clock-interface

[![Total Downloads](https://camo.githubusercontent.com/e821ca694fb589ff5ee9d548a4a30dc81e99667ca495bda463486454fdaad290/687474703a2f2f706f7365722e707567782e6f72672f7374656c6c612d6d617269732f636c6f636b2f646f776e6c6f616473)](https://packagist.org/packages/stella-maris/clock)[![Latest Stable Version](https://camo.githubusercontent.com/6a55321ea49696cfadbd626d5af3a36d246c5bc0f283169a1fa1499f7d66b522/687474703a2f2f706f7365722e707567782e6f72672f7374656c6c612d6d617269732f636c6f636b2f76)](https://packagist.org/packages/stella-maris/clock)[![Latest Unstable Version](https://camo.githubusercontent.com/88f486cde41fee68a09990f81dc6a2ca75629155af5bc61ca49c9ee4adcf196d/687474703a2f2f706f7365722e707567782e6f72672f7374656c6c612d6d617269732f636c6f636b2f762f756e737461626c65)](https://packagist.org/packages/stella-maris/clock)

[![pipeline status](https://camo.githubusercontent.com/a90b360ae6b4abd125ffe31ab3383ff4143938818d50db1ae80329e9ebf820bb/68747470733a2f2f6769746c61622e636f6d2f7374656c6c612d6d617269732f636c6f636b2f6261646765732f6d61696e2f706970656c696e652e737667)](https://gitlab.com/stella-maris/clock/-/commits/main)

Installation
------------

[](#installation)

```
composer require stella-maris/clock
```

Usage
-----

[](#usage)

This interface allows one to inject one of the implemntations that provide the clock-interface.

```
use StellaMaris/Clock/CLockInterface;

final class PastChecker
{
    public function __construct(private ClockInterface $clock) {}

    public function hasDateTimeAlreadyPassed(DateTimeImmutable $item): bool
    {
        return $item < $this->clock->now();
    }
}
```

Why
---

[](#why)

Within the Framework Interoperability Group (FIG) a working group has started in 2021 to create a ClockInterface. The works on that have been rather fast and already in the mid of 2021 the interface was more or less finally decided upon.

### So why this Interface?

[](#so-why-this-interface)

Since mid 2021 no further work has been happening on the Working Group. All requests towards the editor and the sponsor weren't met with any reaction.

So after a lot of discussions on the official working group channel I decided to bring this interface forward by providing the currently agreed upon interface as a separate package on packagist.

### But what when the PSR Interface is provided?

[](#but-what-when-the-psr-interface-is-provided)

There are two possibilities:

- Either the interface will be provided by the FIG as it is currently, then this interface will extend the PSR-20 one so that all implementations of this interface will be immediately PSR20 compatible.
- Or the PSR20 interface will look different: Then all current implementations will need to provide a spearate implementation for PSR20 compatibility and this interface will simply coexist with the PSR20 one.

Documentation
-------------

[](#documentation)

For a more thorough information about the interface please check the PSR-20 documentation at  and

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity61

Solid adoption and visibility

Community15

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Recently: every ~55 days

Total

8

Last Release

1270d ago

PHP version history (2 changes)0.1.0PHP ^7.1|^8.0

0.1.1PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ae5183aaad2bc7453230704bd6991dc6ccbcd6e775c6a29efdc94350a69f247?d=identicon)[heiglandreas](/maintainers/heiglandreas)

---

Top Contributors

[![heiglandreas](https://avatars.githubusercontent.com/u/91998?v=4)](https://github.com/heiglandreas "heiglandreas (13 commits)")[![macbookandrew](https://avatars.githubusercontent.com/u/784333?v=4)](https://github.com/macbookandrew "macbookandrew (2 commits)")[![drupol](https://avatars.githubusercontent.com/u/252042?v=4)](https://github.com/drupol "drupol (1 commits)")

---

Tags

clocktimeclockpsr20datetimepoint in time

### Embed Badge

![Health badge](/badges/stella-maris-clock/health.svg)

```
[![Health](https://phpackages.com/badges/stella-maris-clock/health.svg)](https://phpackages.com/packages/stella-maris-clock)
```

###  Alternatives

[psr/clock

Common interface for reading the clock.

642332.9M343](/packages/psr-clock)[symfony/clock

Decouples applications from the system clock

431168.9M205](/packages/symfony-clock)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

177661.4M4.8k](/packages/nesbot-carbon)[beste/clock

A collection of Clock implementations

7423.3M20](/packages/beste-clock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
