PHPackages                             paliari/php-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. paliari/php-utils

ActiveLibrary

paliari/php-utils
=================

PHP utils

2.0.1(2y ago)05.0k↓30%1[2 PRs](https://github.com/paliari/php-utils/pulls)9MITPHPCI passing

Since Jan 16Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/paliari/php-utils)[ Packagist](https://packagist.org/packages/paliari/php-utils)[ RSS](/packages/paliari-php-utils/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (42)Used By (9)

php-utils
=========

[](#php-utils)

#### Installation

[](#installation)

```
$ composer require paliari/php-utils

```

#### Usage

[](#usage)

##### Bump

[](#bump)

Increment version of composer.json.

Params:

- **--git** or **-g** Commit composer.json bumped and create the git tag
- **--version** or **-v** Version type &lt;major | minor | patch | prerelase&gt; or custom version &lt;1.0.0-pre1&gt;. Default is patch
- **--file** or **-f** Composer json file &lt;composer.json&gt;. Default is composer.json

    ```
      $ vendor/bin/bump -v major -f custom_composer.json -g
      Or
      $ vendor/bin/bump --version 1.0.0 --file custom_composer.json --git
      Or
      $ vendor/bin/bump -v minor --git

    ```

##### Array

[](#array)

Array facades.

```
    $a1 = ['a' => 1];
    $a2 = ['b' => ['b1' => 2]];
    $a3 = \Paliari\Utils\A::merge($a1, $a2);
    var_export($a3);
    // export to ['a' => 1, 'b' => ['b1' => 2]]

    $val = \Paliari\Utils\A::deepKey($a3, 'b.b1');
    var_export($val);
    // export to 2;

    $flatten = \Paliari\Utils\A::flatten($a3);
    var_export($flatten);
    // export to [1, 2];

```

##### Function

[](#function)

```
    // explode string of space, aliases to explode(' ', $str);
    $str = 'a b 1.3d a-x';
    $a = w($str);
    var_export($a);
    // export to ['a', 'b', '1.3d', 'a-x'];

```

##### Logger

[](#logger)

Write log to file

```

    // config custom file log, default is realpath(sys_get_temp_dir()) . '/php-util.log'
    $file = __DIR__.'/tmp/logs/test.log';
    \Paliari\Utils\Logger::file($file);

    //Methods avaliables: "critical, error, warning, notice, info, debug".

    // info
    \Paliari\Utils\Logger::info('Yor custom message.');

```

##### CatchFatalError

[](#catchfatalerror)

```

    // Init
    \Paliari\Utils\CatchFatalError::init();
    // Or
    \Paliari\Utils\CatchFatalError::init(function ($e) {
        // ... custom handler actions, ex: send mail, save custom log...
        return $e['message'];
    });

```

##### Url

[](#url)

Facade of url parse.

```

    // Example
    $url = 'https://domain.com/home/?p=1&q[a]=11&q[b]=22#/home';
    $u = \Paliari\Utils\Url::parse($url);
    var_export($u);
    // expected
    /*
    Paliari\Utils\Url::__set_state(array(
       'scheme' => 'https',
       'host' => 'domain.com',
       'port' => NULL,
       'user' => NULL,
       'pass' => NULL,
       'path' => '/home/',
       'query' => 'p=1&q[a]=11&q[b]=22',
       'fragment' => '/home',
       'url' => 'https://domain.com/home/?p=1&q[a]=11&q[b]=22#/home',
    ))
    */

    // Method queryToArray convert query string to array.
    var_export($u->queryToArray());
    // expected
    /*
    array (
      'p' => '1',
      'q' =>
      array (
        'a' => '11',
        'b' => '22',
      ),
    )
    */

```

### Authors

[](#authors)

- [Marcos Paliari](http://paliari.com.br)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance53

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity75

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

Recently: every ~278 days

Total

40

Last Release

930d ago

Major Versions

1.2.3 → 2.0.02022-03-20

### Community

Maintainers

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

---

Top Contributors

[![paliari](https://avatars.githubusercontent.com/u/2801041?v=4)](https://github.com/paliari "paliari (113 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paliari-php-utils/health.svg)

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

PHPackages © 2026

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