PHPackages                             zenigata/utility - 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. zenigata/utility

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

zenigata/utility
================

0.2.4(1mo ago)1211MITPHPPHP ^8.2 || ^8.3 || ^8.4CI passing

Since Oct 22Pushed 1mo agoCompare

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

READMEChangelogDependencies (21)Versions (14)Used By (1)

Zenigata Utility
================

[](#zenigata-utility)

> ⚠️ This project is in an early development stage. Feedback and contributions are welcome!

Lightweight collection of PHP utility classes to simplify common development tasks.

The library provides small, focused helpers and traits that reduce boilerplate when working with **PSR standards**, configuration files, reflection, and more. Each component is designed to be **framework-agnostic**, minimal, and easy to integrate into any PHP project.

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

[](#requirements)

- PHP &gt;= 8.2
- [Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos)

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

[](#installation)

```
composer require zenigata/utility
```

Overview
--------

[](#overview)

### Awareness

[](#awareness)

Traits that provide **awareness for common dependencies**, allowing classes to receive services such as containers, factories, or debug state without requiring dependency injection.

- [`ContainerAwareTrait`](./src/Awareness/ContainerAwareTrait.php) provides access to a **PSR-11 container** and helper methods for retrieving services.
- [`DebugAwareTrait`](./src/Awareness/DebugAwareTrait.php) adds a configurable **debug flag** to enable or disable development features.
- [`ResponseFactoryAwareTrait`](./src/Awareness/ResponseFactoryAwareTrait.php) provides access to a **PSR-17 response factory** for creating HTTP responses.
- [`StreamFactoryAwareTrait`](./src/Awareness/StreamFactoryAwareTrait.php) provides access to a **PSR-17 stream factory** for creating HTTP streams.

### Helper

[](#helper)

Collection of small utilities that simplify common tasks such as configuration loading, caching interoperability, file generation, and more.

- [`CacheHelper`](./src/Helper/CacheHelper.php) for interacting with both **PSR-6** and **PSR-16** caches with a unified API. It hides the differences between the two standards, so you can use the **same methods** regardless of the underlying cache implementation.
- [`ConfigLoader`](./src/Helper/ConfigLoader.php) for lazily loading PHP configuration files using **generators**, ensuring minimal memory usage when working with multiple config files.
- [`ReflectionResolver`](./src/Helper/ReflectionResolver.php) for instantiating classes with empty constructors using **PHP reflection**, useful when no **dependency injection container** is available.
- [`StubRenderer`](./src/Helper/StubRenderer.php) for generating files from **stub templates** with placeholder replacement and automatic directory creation.

### Testing

[](#testing)

Simple **test doubles** designed to simplify unit testing when full implementations are unnecessary.

- [`FakeContainer`](./src/Testing/FakeContainer.php): in-memory implementation of **PSR-11** `ContainerInterface`, useful for testing container-aware classes and manually registering dependencies.
- [`FakeLogger`](./src/Testing/FakeLogger.php): lightweight **PSR-3 logger** that records log messages in memory, allowing tests to inspect and assert logged output.

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

[](#contributing)

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

Keep the implementation minimal, focused, and well-documented, making sure to update tests accordingly.

See [CONTRIBUTING](./CONTRIBUTING.md) for more information.

License
-------

[](#license)

This library is licensed under the MIT license. See [LICENSE](./LICENSE) for more information.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

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 ~13 days

Recently: every ~4 days

Total

13

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/12257fdf1165bd832b52334eed68807448f2fe1aa31e2bedf58a6a8c75dae760?d=identicon)[ilariopro](/maintainers/ilariopro)

---

Top Contributors

[![ilariopro](https://avatars.githubusercontent.com/u/28644849?v=4)](https://github.com/ilariopro "ilariopro (43 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zenigata-utility/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[windwalker/framework

The next generation PHP framework.

25639.1k1](/packages/windwalker-framework)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)

PHPackages © 2026

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