PHPackages                             sharoff45/library-support - 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. sharoff45/library-support

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

sharoff45/library-support
=========================

Helper Library

v1.0.0(4y ago)03proprietaryPHPPHP &gt;=8.0

Since Jun 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Sharoff45/library-support)[ Packagist](https://packagist.org/packages/sharoff45/library-support)[ RSS](/packages/sharoff45-library-support/feed)WikiDiscussions master Synced today

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

composer:

```
composer require sharoff45/library-support

```

Описание функций и одноименных классов
--------------------------------------

[](#описание-функций-и-одноименных-классов)

### isEmptyArrayFilter

[](#isemptyarrayfilter)

```
[] === array_filter($array)

```

### isNotEmptyArrayFilter

[](#isnotemptyarrayfilter)

```
[] !== array_filter($array)

```

### isEmptyArray \[IsEmptyArray\]

[](#isemptyarray-isemptyarray)

```
[] === $value

```

### isNotEmptyArray \[IsNotEmptyArray\]

[](#isnotemptyarray-isnotemptyarray)

```
true === is_array($value) && [] !== $value

```

### isNotEmptyString \[IsNotEmptyString\]

[](#isnotemptystring-isnotemptystring)

```
true === is_string($value) && '' !== $value

```

### isNotNull \[IsNotNull\]

[](#isnotnull-isnotnull)

```
null !== $value

```

### isNull \[IsNull\]

[](#isnull-isnull)

```
null === $value

```

### isNullOrEmptyString \[IsNullOrEmptyString\]

[](#isnulloremptystring-isnulloremptystring)

```
null === $value || '' === $value

```

### isNullOrZeroNumber \[IsNullOrZeroNumber\]

[](#isnullorzeronumber-isnullorzeronumber)

```
null === $value || 0 === $value || 0.0 === $value

```

### Прочее

[](#прочее)

- `strStartsWith` проверяет, начинается ли строка с указанных символов (подстроки)
- `objectToArray` возвращает данные объекта без рефлексии

```
    class A
    {
    	private $a = 1;
    	protected $b = 2;
    	public $c = 3;
    }

    var_dump(objectToArray(new A));

```

result

```
array:3 [▼
  "a" => 1
  "b" => 2
  "c" => 3
]

```

- `all` Возвращает TRUE, если каждый элемент массива удовлетворяет условию в $callback функции

```
$isBelowThreshold = function ($value) {
    return $value < 40;
};

$items = [1, 30, 39, 29, 10, 13];

var_dump(all($items, $isBelowThreshold));

```

result

```
true

```

- MethodHelper::isSetter - true, если название метода начинается с set\[A-Z\]
- MethodHelper::isAdder - true, если название метода начинается с add\[A-Z\]
- MethodHelper::isGetter - true, если название метода начинается с get\[A-Z\]
- MethodHelper::isLogic - true, если название метода начинается с is\[A-Z\] или getIs\[A-Z\]

Примеры использования с array\_filter
-------------------------------------

[](#примеры-использования-с-array_filter)

```
use Sharoff45\Library\Support\IsNotEmptyArray;
use Sharoff45\Library\Support\IsNotEmptyString;
use Sharoff45\Library\Support\IsNotNull;
use Sharoff45\Library\Support\IsNull;
use Sharoff45\Library\Support\IsNullOrEmptyString;
use Sharoff45\Library\Support\IsEmptyArray;

// ...
$result = array_filter($list, new IsNotEmptyArray());

//...
$result = array_filter($list, new IsNotEmptyString());

// ...
$result = array_filter($list, new IsNotNull());

//...
$result = array_filter($list, new IsNull());

// ...
$result = array_filter($list, new IsNullOrEmptyString());

// ...
$result = array_filter($list, new IsEmptyArray());
```

Примеры использования в условиях
--------------------------------

[](#примеры-использования-в-условиях)

```
use function Sharoff45\Library\Support\isEmptyArray;
use function Sharoff45\Library\Support\isNotEmptyArray;
use function Sharoff45\Library\Support\isNotEmptyString;
use function Sharoff45\Library\Support\isNotNull;
use function Sharoff45\Library\Support\isNull;
use function Sharoff45\Library\Support\isNullOrEmptyString;
use function Sharoff45\Library\Support\isEmptyArrayFilter;
use function Sharoff45\Library\Support\isNotEmptyArrayFilter;

if (isEmptyArray($value)) {}

if (isNotEmptyArray($value)) {}

if (isNotEmptyString($value)) {}

if (isNotNull($value)) {}

if (isNull($value)) {}

if (isNullOrEmptyString($value)) {}

if (isEmptyArrayFilter($array)) {}

if (isNotEmptyArrayFilter($array)) {}
```

Функции для работы с JSON
-------------------------

[](#функции-для-работы-с--json)

### Кидирование

[](#кидирование)

- Json::encode - возвращает JSON-представление данных

```
echo Json::encode(['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5]);

```

result

```
{"a":1,"b":2,"c":3,"d":4,"e":5}

```

### Декодирование

[](#декодирование)

- Json::decodeAsArray - объекты JSON будут возвращены как ассоциативные массивы (array)

```
var_dump(Json::decodeAsArray('{"a":1,"b":2,"c":3,"d":4,"e":5}'));

```

result

```
array(5) {
    ["a"] => int(1)
    ["b"] => int(2)
    ["c"] => int(3)
    ["d"] => int(4)
    ["e"] => int(5)
}

```

- Json::decodeAsObject - объекты JSON будут возвращены как объекты (object)

```
var_dump(Json::decodeAsObject('{"a":1,"b":2,"c":3,"d":4,"e":5}'));

```

result

```
object(stdClass)#1 (5) {
    ["a"] => int(1)
    ["b"] => int(2)
    ["c"] => int(3)
    ["d"] => int(4)
    ["e"] => int(5)
}

```

```
В случае ошибки возвращается  `JsonException`

```

Генерация Uuid
--------------

[](#генерация-uuid)

Метод UuidGenerator::getUuid используется для того чтобы получить uuid независимо от того получили ли мы на входе ID или уже готовый uuid

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

1484d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9ecc03c149bc9acdc83ae71fc5087e2e2c8c8a5ab3e4da0f0385bfb729bd195?d=identicon)[Sharoff45](/maintainers/Sharoff45)

---

Top Contributors

[![Sharoff45](https://avatars.githubusercontent.com/u/7892544?v=4)](https://github.com/Sharoff45 "Sharoff45 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sharoff45-library-support/health.svg)

```
[![Health](https://phpackages.com/badges/sharoff45-library-support/health.svg)](https://phpackages.com/packages/sharoff45-library-support)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M734](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M571](/packages/shopware-core)[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k78.3k89](/packages/pocketmine-pocketmine-mp)[symfony/ux-autocomplete

JavaScript Autocomplete functionality for Symfony

645.9M39](/packages/symfony-ux-autocomplete)

PHPackages © 2026

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