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

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

scyzoryck/clock
===============

05PHP

Since Apr 6Pushed 8y agoCompare

[ Source](https://github.com/scyzoryck/clock)[ Packagist](https://packagist.org/packages/scyzoryck/clock)[ RSS](/packages/scyzoryck-clock/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Clock
=====

[](#clock)

Did you ever wonder how to control your time? This library is created for you! It provides a `Clock` interface that allows you to create current datetime in a controlled way!

Installing
----------

[](#installing)

```
composer require scyzoryck/clock
```

Clock types
-----------

[](#clock-types)

The provided implementations of `Clock` are:

- `RealTimeClock` - always returns the real time.
- `StoppedClock` - it always returns times that you have provided in constructor! Useful for tests.
- `RunningClock` - as the previous one it use the time from constructor, but this time is running.
- `TransactionalClock` - wrapper, that allows you to stop the time for some long running operations.

Adapters
--------

[](#adapters)

The method `Clock::now()` returns an instance of `\DateTimeImmutable`. You can use adapters if you need some others DateTime objects.

- `MutableDateTimeClock` - creates an instance of `\DateTime`

Running Unit Tests
==================

[](#running-unit-tests)

```
composer install
php vendor/bin/phpunit
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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://avatars.githubusercontent.com/u/8014727?v=4)[Marcin Czarnecki](/maintainers/scyzoryck)[@scyzoryck](https://github.com/scyzoryck)

### Embed Badge

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

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

###  Alternatives

[solarissmoke/disable-comments-mu

This is the must-use version of the Disable Comments WordPress plugin. Copy the contents of this directory into your mu-plugins directory in order to disable comments on the entire site/network, without any configuration. You should delete all existing comments from the WordPress database before activating this plugin. If you want to be able to configure the plugin's behaviour, then use the normal version.

6570.2k](/packages/solarissmoke-disable-comments-mu)[dstuecken/php7ify

php7ify is a project that brings new php7 classes and exceptions to php 5.x.

11159.2k1](/packages/dstuecken-php7ify)

PHPackages © 2026

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