PHPackages                             danilovl/helper-utils - 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. danilovl/helper-utils

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

danilovl/helper-utils
=====================

Universal collection of helper utilities: dates, strings, arrays, files, network, reflection, hashing, colors and more.

v0.0.1(1mo ago)00MITPHPPHP ^8.5.0CI passing

Since Apr 25Pushed 1mo agoCompare

[ Source](https://github.com/danilovl/helper-utils)[ Packagist](https://packagist.org/packages/danilovl/helper-utils)[ RSS](/packages/danilovl-helper-utils/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (17)Versions (2)Used By (0)

[![phpunit](https://github.com/danilovl/helper-utils/actions/workflows/phpunit.yml/badge.svg)](https://github.com/danilovl/helper-utils/actions/workflows/phpunit.yml)[![downloads](https://camo.githubusercontent.com/0a62015c925d70c2eb83d8735c3dfb87a1fc57629c683837840779f82b6d3662/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616e696c6f766c2f68656c7065722d7574696c73)](https://packagist.org/packages/danilovl/helper-utils)[![latest Stable Version](https://camo.githubusercontent.com/1a31cdc65fe5c443f565e029ea50ac48282bb4777e820f3c40c3faf7b49ddaa6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616e696c6f766c2f68656c7065722d7574696c73)](https://packagist.org/packages/danilovl/helper-utils)[![license](https://camo.githubusercontent.com/0b7c1b80bcba665ab12939fb84f7f4696755e7d91becf9e1f6da98b91ea2ad17/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64616e696c6f766c2f68656c7065722d7574696c73)](https://packagist.org/packages/danilovl/helper-utils)

🛠️ Helper Utils
===============

[](#️-helper-utils)

Universal collection of **PHP 8.5+** helper utilities — dates, strings, arrays, files, network, reflection, hashing, colors, validation and more.

This is a **standalone library**, not a Symfony bundle. It does not require any framework configuration. Helpers that depend on the current time, timezone, or other side-effects either accept those as explicit method parameters (for static helpers) or are injected via constructor (for service helpers).

---

🚀 Key Features
--------------

[](#-key-features)

- **Modern PHP**: Strictly typed for PHP 8.5+.
- **Zero Configuration**: Works out of the box in any project.
- **Framework Agnostic**: Core logic is pure PHP, with optional integrations for Symfony components.
- **Testable**: Design focuses on mockability and explicit state management.
- **Developer Experience**: Consistent naming, clean API, and comprehensive documentation.

📦 Installation
--------------

[](#-installation)

```
composer require danilovl/helper-utils
```

🛠️ Included Helpers
-------------------

[](#️-included-helpers)

### Static Helpers

[](#static-helpers)

*All helper classes are `final` with private constructors.*

GroupClassesDescription**Array**`ArrayHelper`, `ArrayMapHelper`, `CollectionHelper`Operations with arrays, mapping, filtering, and grouping.**Color**`ColorHelper`Color manipulation and conversions (HEX, RGB).**Compare**`CompareHelper`, `VersionHelper`Value and semantic version comparison utilities.**Date**`DateHelper`, `DatePeriodHelper`, `BusinessDayHelper`Powerful date parsing, manipulation, and period calculations.**File**`FileHelper`, `PathHelper`Filesystem operations, path handling, and metadata.**Form**`FormValidationMessageHelper`Symfony Form error extraction and management.**Hash**`HashHelper`, `TokenHelper`Secure hash generation and token utilities.**Json**`JsonHelper`Safe JSON encoding and decoding.**Locale**`LocaleHelper`, `CountryHelper`Geographic and linguistic data, country codes.**Network**`IpHelper`, `UrlHelper`IP manipulation (anonymization, ranges) and URL handling.**Number**`NumberHelper`, `MoneyHelper`Formatting numbers, currency, and byte sizes.**Object**`CloneHelper`, `ObjectHelper`Deep cloning and dynamic property access.**Reflection**`ReflectionHelper`, `AttributeHelper`, `EnumHelper`Advanced reflection for classes, attributes, and Enums.**String**`StringHelper`, `HtmlHelper`, `TextHelper`String manipulation, slugging, masking, and HTML cleaning.**Validator**`ValidatorHelper`Helpers for Symfony validation component.**Misc**`RetryHelper`Miscellaneous utilities like retry logic.### Service Helpers

[](#service-helpers)

*DI-injectable, `final readonly` where stateless.*

- **`ClockAwareDateHelper`**: Time-sensitive operations using PSR-20 Clock.
- **`DoctrineHelper`**: Doctrine ORM metadata and entity manager shortcuts.
- **`MemoryHelper`**: Real-time memory usage tracking and formatting.
- **`RequestHelper`**: Convenient wrapper for Symfony's Request objects.
- **`TimerHelper`**: Precise code execution timing and measurement.

### Enums

[](#enums)

- **`ByteUnit`**: Constants for data size units (B, KB, MB, etc.).
- **`ComparisonOperator`**: Common comparison operators for flexible logic.
- **`DateFormat`**: Standardized date and time format strings.

---

💡 Quick Examples
----------------

[](#-quick-examples)

### Static Helpers

[](#static-helpers-1)

```
use Danilovl\HelperUtils\Helper\Date\DateHelper;
use Danilovl\HelperUtils\Helper\String\StringHelper;
use Danilovl\HelperUtils\Helper\Network\IpHelper;

// Dates — explicit "now" for testability
$age  = DateHelper::calculateAge(new DateTimeImmutable('1990-04-25'));
$past = DateHelper::isPast($someDate, $now);

// Strings
$slug = StringHelper::slugify('Привет, мир!');           // "privet-mir"
$mask = StringHelper::maskEmail('john.doe@example.com'); // "j******e@example.com"

// IP Utilities
$ok   = IpHelper::isIpInRange('192.168.1.5', '192.168.1.0/24');
$anon = IpHelper::anonymize('192.168.1.123');             // "192.168.1.0"
```

### Services (Dependency Injection)

[](#services-dependency-injection)

```
use Danilovl\HelperUtils\Service\RequestHelper;
use Danilovl\HelperUtils\Service\ClockAwareDateHelper;

public function __construct(
    private RequestHelper $requestHelper,
    private ClockAwareDateHelper $clock,
) {}

$ip  = $this->requestHelper->getClientIp();
$now = $this->clock->now(); // Easily mockable
```

---

🧪 Quality Assurance
-------------------

[](#-quality-assurance)

We maintain high testing standards to ensure reliability.

```
composer tests
```

The package currently includes **397 unit tests** and **766 assertions**.

### Test Coverage

[](#test-coverage)

GroupStatusArray, Color, Compare, Date, File, Hash, Json, Locale, Network, Number, Object, Reflection, String, Validator, Misc✅ FullService (Request, Clock, Doctrine, Memory, Timer)✅ Full---

📜 Design Principles
-------------------

[](#-design-principles)

- **Immutability**: Preference for `\DateTimeImmutable`.
- **Explicitness**: "Now"-dependent methods accept an explicit timestamp.
- **Safety**: Methods follow the `doSomething` (throws) / `trySomething` (returns null) pattern.
- **Non-Invasive**: Wraps powerful libraries (Symfony, Doctrine) rather than reinventing wheels.
- **Finality**: Classes are `final` to prevent fragile inheritance.

📄 License
---------

[](#-license)

The HelperUtils is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f695c3614981d994e19a87e7b2c892768642a577d7eeeb1c6b4bf899b566557?d=identicon)[danilovl](/maintainers/danilovl)

---

Top Contributors

[![danilovl](https://avatars.githubusercontent.com/u/16228565?v=4)](https://github.com/danilovl "danilovl (2 commits)")

---

Tags

helperarraystringreflectiondateIPutilsutilities

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/danilovl-helper-utils/health.svg)

```
[![Health](https://phpackages.com/badges/danilovl-helper-utils/health.svg)](https://phpackages.com/packages/danilovl-helper-utils)
```

###  Alternatives

[jbzoo/utils

Collection of PHP functions, mini classes and snippets for everyday developer's routine life.

8331.6M36](/packages/jbzoo-utils)[clausnz/php-helpers

A Collection of useful php helper functions.

389.8k](/packages/clausnz-php-helpers)[michaldudek/foundation

A set of useful PHP classes.

13112.4k13](/packages/michaldudek-foundation)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2518.6k](/packages/iteks-laravel-enum)

PHPackages © 2026

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