PHPackages                             org\_heigl/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. org\_heigl/clock

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

org\_heigl/clock
================

minimum sample implementation of PSR-20

20PHP

Since Jul 15Pushed 4y ago2 watchersCompare

[ Source](https://github.com/heiglandreas/clock)[ Packagist](https://packagist.org/packages/org_heigl/clock)[ RSS](/packages/org-heigl-clock/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Clock
=====

[](#clock)

A minimal Sample-Implementation for PSR-20.

This tiny package allows you to inject a clock into your code that will either give you the current date and time (useful for production code) or a predefined one (useful for testing).

Usage
-----

[](#usage)

```
use Org_Heigl\Clock\FrozenClock;
use Org_Heigl\Clock\SystemClock;
use Psr\Clock\ClockInterface;

class App
{
	public function main(ClockInterface $clock): string
	{
	    return sprintf(
	        'The current date and time is %s',
	        $clock->now()->format('Y-m-d H:i:s.u')
	    );
	}
}

$app = new App();
$clock = new SystemClock();

var_Dump($app->main($clock) === $app->main($clock));
// This will most certainly be "false"

$clock = new FrozenClock(new DateTimeImmutable());
var_dump($app->main($clock) === $app->main($clock));
// This will always be true
```

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

[](#installation)

Install the package via composer like this:

```
composer require org_heigl/clock
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### 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 (8 commits)")

### Embed Badge

![Health badge](/badges/org-heigl-clock/health.svg)

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

###  Alternatives

[league/container

A fast and intuitive dependency injection container.

86787.8M343](/packages/league-container)[stella-maris/clock

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

7947.5M2](/packages/stella-maris-clock)[wptrt/wpthemereview

PHP\_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org

217736.5k29](/packages/wptrt-wpthemereview)[inpsyde/modularity

Modular PSR-11 implementation for WordPress plugins, themes or libraries.

54383.3k3](/packages/inpsyde-modularity)[php-standard-library/phpstan-extension

PHPStan PSL extension

201.2M13](/packages/php-standard-library-phpstan-extension)[elie29/zend-phpdi-config

PSR-11 PHP-DI autowire container configurator for Laminas, Mezzio, ZF2, ZF3 and Zend Expressive applications

20238.6k7](/packages/elie29-zend-phpdi-config)

PHPackages © 2026

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