PHPackages                             tumblr/chorus-timekeeper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tumblr/chorus-timekeeper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tumblr/chorus-timekeeper
========================

A super simple class for DI with timekeeping

0.1.1(2y ago)116.6k2[1 PRs](https://github.com/tumblr/chorus-timekeeper/pulls)1GPL-2.0-or-laterPHPPHP ^7.4 || ^8.0

Since Jun 21Pushed 2y ago3 watchersCompare

[ Source](https://github.com/tumblr/chorus-timekeeper)[ Packagist](https://packagist.org/packages/tumblr/chorus-timekeeper)[ RSS](/packages/tumblr-chorus-timekeeper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (3)Used By (1)

Chorus TimeKeeper
=================

[](#chorus-timekeeper)

The **Chorus TimeKeeper** is an elegant utility for Dependency Injection (DI) with timekeeping. At its core, it offers a straightforward approach to time management in applications, allowing for consistent time retrieval and even time manipulation for testing purposes. This can be exceptionally helpful when writing tests or simulating various time conditions in your code.

It provides two primary components:

1. `TimeKeeper`: Fetches real-time data.
2. `FakeTimeKeeper`: Helps in mocking or manipulating time during testing.

For example, when testing time-sensitive components, you can utilize `FakeTimeKeeper` to preset time scenarios, avoiding the hassle of waiting in real-time or simulating date changes on your system.

Requirements
------------

[](#requirements)

- PHP ^7.4 or ^8.0

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

[](#installation)

You can install the package via Composer:

```
composer require tumblr/chorus-timekeeper
```

Basic Usage
-----------

[](#basic-usage)

```
// Using the real TimeKeeper
$timekeeper = new Tumblr\Chorus\TimeKeeper();

echo $timekeeper->getCurrentUnixTime();  // Outputs the current unix epoch time.

// Using the FakeTimeKeeper
$fakeTimeKeeper = new Tumblr\Chorus\FakeTimeKeeper(1628700000);  // Set a specific unix time.

echo $fakeTimeKeeper->getCurrentUnixTime();  // Outputs 1628700000.
```

Development Workflow
--------------------

[](#development-workflow)

The project has a Makefile to simplify development processes. You can use various make commands to run tests, validate code standards, and more. Here's a quick overview:

### 1. Prerequisites Setup

[](#1-prerequisites-setup)

Ensure your environment is set up correctly:

- Install required packages:

```
make prerequisites
```

- Report PHP location:

```
make report-php-location
```

### 2. Testing

[](#2-testing)

Run all tests:

```
make test
```

Run only PHPUnit tests:

```
make phpunit
```

Generate PHPUnit test coverage:

```
make phpunit-coverage
```

### 3. Static Analysis

[](#3-static-analysis)

Use psalm for static analysis:

```
make sa
```

### 4. Code Standards

[](#4-code-standards)

Fix coding standards using PHP CS Fixer:

```
make cs
```

### 5. Mutation Testing

[](#5-mutation-testing)

Run mutation tests to ensure code quality:

```
make mt
```

### 6. Composer

[](#6-composer)

Validate composer files:

```
make composer-validate
```

### 7. YAML Linting

[](#7-yaml-linting)

Lint YAML files to ensure correctness:

```
make yamllint
```

Contributing
------------

[](#contributing)

If you wish to contribute to the Chorus TimeKeeper, please follow these steps:

1. **Raise an Issue**: Before making any changes, create an issue describing your idea or the desired change.
2. **Submit a PR**: Once your idea is approved, create a Pull Request. Make sure to include or update unit tests.
3. **Testing &amp; Code Style**: Ensure all tests pass (`make test`) and fix any code style issues (`make cs`).
4. **Describe Your Changes**: Clearly describe what you've changed and include testing instructions.
5. **Breaking Changes Alert**: If your contribution introduces breaking changes, please highlight them. Any modification that disrupts the current workflow, like changing a namespace or functionality, is a breaking change.

Remember, if you're planning a significant refactor or introducing breaking changes, your PR might not be approved.

Once your PR is approved, it will be merged, and a new version will be released.

License
-------

[](#license)

This project is licensed under the [GNU General Public License v2.0](LICENSE).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~0 days

Total

2

Last Release

1056d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/edcb8dde95c71b1c97c3c91e57d3548795fa2014c657744fb878e2be3b5949fc?d=identicon)[sanmai](/maintainers/sanmai)

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

---

Top Contributors

[![sanmai](https://avatars.githubusercontent.com/u/139488?v=4)](https://github.com/sanmai "sanmai (8 commits)")[![rtio](https://avatars.githubusercontent.com/u/5431713?v=4)](https://github.com/rtio "rtio (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tumblr-chorus-timekeeper/health.svg)

```
[![Health](https://phpackages.com/badges/tumblr-chorus-timekeeper/health.svg)](https://phpackages.com/packages/tumblr-chorus-timekeeper)
```

###  Alternatives

[dotty/dotty

Easy access to array data using dot notation

1293.8k1](/packages/dotty-dotty)

PHPackages © 2026

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