PHPackages                             time2split/time2help - 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. time2split/time2help

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

time2split/time2help
====================

Utilities shared accross the time2split projects

v0.4.0(2mo ago)0891MITPHPPHP &gt;=8.3CI passing

Since Mar 23Pushed 2mo agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (9)Used By (1)

Time2Help
=========

[](#time2help)

[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://opensource.org/licenses/MIT)[![Latest Stable Version](https://camo.githubusercontent.com/7a3a6544ab8af35a00fce8e5bf2d738a33a687b05f745becc7040643ccdc8eb4/68747470733a2f2f706f7365722e707567782e6f72672f74696d653273706c69742f74696d653268656c702f76)](https://packagist.org/packages/time2split/time2help)[![Latest Unstable Version](https://camo.githubusercontent.com/bae17d79a48d3389e721584529b3dac0d517dfc5fb0f2796cb62c5ca18b5cab4/68747470733a2f2f706f7365722e707567782e6f72672f74696d653273706c69742f74696d653268656c702f762f756e737461626c65)](https://packagist.org/packages/time2split/time2help)

Time2Help is an utility library made in the first place to be shared across all Time2Split's projects. Nevertheless, its functionnalities may be used in any php project.

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

[](#installation)

The library is distributed as a Composer project.

```
$ composer require time2split/time2help
```

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

[](#documentation)

- [API documentation](https://time2split.net/php-time2help/)

Features
--------

[](#features)

The library serves 3 main domains:

1. container
2. inputs/outputs (IO)
3. tests

### Container

[](#container)

The container domain provides functionalities to works on different type of containers. It's purpose is

1. to facilitate operations through iteration on each container entry (key =&gt; value) and
2. provides implementations of usefull data structure.

Iterating through an iterable to do some operations on each item appears to be a common task in a program. The library provides functionnalities to works on [arrays](https://time2split.net/php-time2help/classes/Time2Split-Help-Arrays.html), and more generally on [iterables](https://time2split.net/php-time2help/classes/Time2Split-Help-Iterables.html)(which have the advantage to be able to work on efficient [Generators](https://www.php.net/manual/en/class.generator.php)).

For instance, an iterating function can be: to iterate in reverse order, iterate only on key, filter the entries to be iterated, apply an operation to each entries of a container, flip the entry key and value; and any composition of the provided functions. (Consult the API documentation if interested to know all the existing functions.)

The container functions return mainly [\\Iterator](https://www.php.net/manual/en/class.iterator.php) instances, that internally are more specifically [\\Generator](https://www.php.net/manual/en/class.generator.php). Generators have the advantage to be space-efficient: they just return an entry through an iteration without the need to store all the entries to be returned. All iteration operations on containers return iterators. Moreover it's so easy to get an array from an iterable with [\\iterator\_to\_array()](https://www.php.net/manual/en/function.iterator-to-array.php) that the library as no interest in returning less space-efficient array values.

Tree-shaped structured are also covered for [arrays](https://time2split.net/php-time2help/classes/Time2Split-Help-ArrayTrees.html) and [iterables](https://time2split.net/php-time2help/classes/Time2Split-Help-IterableTrees.html).

Concerning the second purpose of the container domain, the library provides implementations for the [Set](https://time2split.net/php-time2help/classes/Time2Split-Help-Set.html) and [Optional](https://time2split.net/php-time2help/classes/Time2Split-Help-Optional.html)data-structures and more basic functionnalities on [lists](https://time2split.net/php-time2help/classes/Time2Split-Help-ArrayLists.html) (array with integer keys).

### IO

[](#io)

The IO domain provides 3 utility classes.

- [CharPredicates](https://time2split.net/php-time2help/classes/Time2Split-Help-CharPredicates.html)Functions to create char predicate closures.
- [IO](https://time2split.net/php-time2help/classes/Time2Split-Help-IO.html)Functions for inputs/outputs.
- [Streams](https://time2split.net/php-time2help/classes/Time2Split-Help-Streams.html)Functions for stream resource.

Streams and Char predicate where made mainly to facilitate the writing of parsers. CharPredicate permits to generate char predicate closures. Streams provides functions for reading on php resource streams.

IO provides functions to works with the filesystem and the php output buffer, and also somme facilities to launch an external cli command and retrieves the output and the errors.

### tests

[](#tests)

The tests domain was mad to facilitate the writting of unit test with PHPUnit. It provides 2 classes

1. [Producer](https://time2split.net/php-time2help/classes/Time2Split-Help-Tests-DataProvider-Producer.html)
2. [Provided](https://time2split.net/php-time2help/classes/Time2Split-Help-Tests-DataProvider-Provided.html)

The use case is to

1. Write an iterable of Provided, that can be viewed as an incomplete database of arguments to be send to a unit test method
2. Make the complete iterable of dataset to be returned by a [DataProvider](https://docs.phpunit.de/en/11.0/writing-tests-for-phpunit.html#data-providers) with a space-efficient [cartesian product](https://time2split.net/php-time2help/classes/Time2Split-Help-Provided.html#method_merge)between multiple Provided databases.

The advantage of this workflow is that it's easy to conceptualise the different database to write and to compose them. The cartesian product generate automatically a PHPUnit dataset's name and arguments, and is able to dynamically generate a data when a specific database argument is selected by the cartesian product. The cartesian product implementation uses internally a Generator. That Generator do not stores the all cartesian product in a container, but it generates each dataset only when needed by a test method.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance83

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~48 days

Recently: every ~7 days

Total

8

Last Release

85d ago

PHP version history (2 changes)v0.1.0PHP &gt;=8.2

v0.2.1PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7b266ae57fafb9b9e19f58ca7bccef0bf210a253c345946140e4c6a834b75e0?d=identicon)[zuri-TTS](/maintainers/zuri-TTS)

---

Top Contributors

[![zuri-TTS](https://avatars.githubusercontent.com/u/32542593?v=4)](https://github.com/zuri-TTS "zuri-TTS (131 commits)")

---

Tags

utilitieshelp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/time2split-time2help/health.svg)

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

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[lodash-php/lodash-php

A port of Lodash to PHP

527719.0k5](/packages/lodash-php-lodash-php)[kartik-v/yii2-helpers

A collection of useful helper functions for Yii Framework 2.0

883.0M29](/packages/kartik-v-yii2-helpers)[longman/ip-tools

PHP IP Tools for manipulation with IPv4 and IPv6

147245.6k6](/packages/longman-ip-tools)[mathiasverraes/classfunctions

Functions to manipulate class names

34472.6k10](/packages/mathiasverraes-classfunctions)[andreas-glaser/php-helpers

A comprehensive collection of PHP utility functions for array manipulation, string operations, date handling, HTML generation, form building, validation, and more. Modern PHP 8.2+ library with full type safety.

1386.5k2](/packages/andreas-glaser-php-helpers)

PHPackages © 2026

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