PHPackages                             soldatov/helpers - 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. soldatov/helpers

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

soldatov/helpers
================

Helpers for string, array, objects, etc.

v1.2.2(3y ago)01.1kMITPHPPHP ^7.3 || ^8.0

Since Sep 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/soldatov/helpers)[ Packagist](https://packagist.org/packages/soldatov/helpers)[ RSS](/packages/soldatov-helpers/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Helpers
=======

[](#helpers)

Helpers that extend the standard functionality of the PHP.

StringHelper
------------

[](#stringhelper)

### StringHelper::parseToBool

[](#stringhelperparsetobool)

Helps to recognize a boolean value.

```
use Soldatov\Helpers\StringHelper;

var_dump(StringHelper::parseToBool('да')); // bool(true)
var_dump(StringHelper::parseToBool('Yes')); // bool(true)
var_dump(StringHelper::parseToBool('  yes')); // bool(true)
var_dump(StringHelper::parseToBool('YES  ')); // bool(true)
var_dump(StringHelper::parseToBool('Y')); // bool(true)
var_dump(StringHelper::parseToBool('y')); // bool(true)
var_dump(StringHelper::parseToBool('t')); // bool(true)
var_dump(StringHelper::parseToBool('1')); // bool(true)
var_dump(StringHelper::parseToBool(1)); // bool(true)
var_dump(StringHelper::parseToBool(true)); // bool(true)
/* etc. */

var_dump(StringHelper::parseToBool('нет')); // bool(false)
var_dump(StringHelper::parseToBool('no')); // bool(false)
var_dump(StringHelper::parseToBool('n')); // bool(false)
var_dump(StringHelper::parseToBool('false')); // bool(false)
var_dump(StringHelper::parseToBool('none')); // bool(false)
var_dump(StringHelper::parseToBool('0')); // bool(false)
var_dump(StringHelper::parseToBool(0)); // bool(false)
var_dump(StringHelper::parseToBool(false)); // bool(false)
/* etc. */
```

### StringHelper::parseJson

[](#stringhelperparsejson)

```
use Soldatov\Helpers\StringHelper;
StringHelper::parseJson('asd'); // Fatal error: Uncaught JsonException: Syntax error in ...
```

```
use Soldatov\Helpers\StringHelper;
var_export(StringHelper::parseJson('{"a": 123}')); // array ('a' => 123,)
var_export(StringHelper::parseJson('  {"a":    123}    ')); // array ('a' => 123,)
```

### StringHelper::oneSpace

[](#stringhelperonespace)

Removes extra spaces from a string.

```
use Soldatov\Helpers\StringHelper;
var_export(StringHelper::oneSpace('One    two 3  ')); // 'One two 3'
```

### StringHelper::slicer

[](#stringhelperslicer)

Splits a string by words into substrings that are no more than a certain length. Supports UTF-8.

```
use Soldatov\Helpers\StringHelper;
var_export(StringHelper::slicer('One two One three', 10)); // array (0 => 'One two', 1 => 'One three')
```

VarHelper
---------

[](#varhelper)

### VarHelper::checkVarType

[](#varhelpercheckvartype)

Checks if a variable is of a specific type.

```
use Soldatov\GetType\Types;
use Soldatov\Helpers\VarHelper;

$var = 'test';
VarHelper::checkVarType($var, [Types::TYPE_STRING]); // ok
VarHelper::checkVarType($var, [Types::TYPE_INTEGER, Types::TYPE_FLOAT]); // BadVarTypeException
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Total

5

Last Release

1118d ago

PHP version history (4 changes)v1.0.0PHP ^7.1

v1.1.0PHP ^7.3

v1.2.1PHP ^7.3 || 8.0.\* || 8.1.\*

v1.2.2PHP ^7.3 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1358824?v=4)[Anatoly Soldatov](/maintainers/soldatov)[@soldatov](https://github.com/soldatov)

---

Top Contributors

[![soldatov](https://avatars.githubusercontent.com/u/1358824?v=4)](https://github.com/soldatov "soldatov (12 commits)")

---

Tags

packagestringhelperphpjsonhelperarrayhelpers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/soldatov-helpers/health.svg)

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

###  Alternatives

[zakirullin/mess

Convenient array-related routine &amp; better type casting

21228.9k2](/packages/zakirullin-mess)[bayfrontmedia/php-array-helpers

Helper class to provide useful array functions.

1413.4k23](/packages/bayfrontmedia-php-array-helpers)[hi-folks/data-block

Data class for managing nested arrays and JSON data.

1472.2k](/packages/hi-folks-data-block)[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.

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

PHPackages © 2026

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