PHPackages                             yiranzai/tools - 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. yiranzai/tools

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

yiranzai/tools
==============

php tools

v1.0.0(6y ago)3010791MITPHPPHP ~7.1CI failing

Since Mar 22Pushed 6y ago2 watchersCompare

[ Source](https://github.com/yiranzai/php-tools)[ Packagist](https://packagist.org/packages/yiranzai/tools)[ Docs](https://github.com/yiranzai/php-tools)[ RSS](/packages/yiranzai-tools/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (6)Versions (8)Used By (1)

php-tools
=========

[](#php-tools)

[ENGLISH](docs/README.md) | [中文](docs/README_ZH_CN.md)

[![Latest Version on Packagist](https://camo.githubusercontent.com/76a5ffc78c747e9ae28a202d25e65790049eef7212e8b34046cec74a9d746df9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796972616e7a61692f746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yiranzai/tools)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](docs/LICENSE.md)[![Build Status](https://camo.githubusercontent.com/e64fb30cda30661731b5f503dc39528f777816bda7bb4196f7703cad245ae6d6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f796972616e7a61692f7068702d746f6f6c732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/yiranzai/php-tools)[![Coverage Status](https://camo.githubusercontent.com/c32e80a1d4d97054cd69ccc6b791e4c320153e3332105d23369f1820c5c6cf8b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f796972616e7a61692f7068702d746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/yiranzai/php-tools/code-structure)[![Quality Score](https://camo.githubusercontent.com/0228244d4cceeb3ccb2e06f3014b3bf1031d2610287c2487e015a092d7c31049/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f796972616e7a61692f7068702d746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/yiranzai/php-tools)[![Total Downloads](https://camo.githubusercontent.com/44421466795bb912319e046a8f0a4f7f255d34bbf0a6f6cb4307f0c4c5f49430/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f796972616e7a61692f746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yiranzai/tools)

php tools

Structure
---------

[](#structure)

```
src/
tests/

```

Install
-------

[](#install)

Via Composer

```
$ composer require yiranzai/tools
```

Usage
-----

[](#usage)

[More please check the user manual](docs/USER_MANUAL.md)

> abstract

- `Arr::class`
    - `\Yiranzai\Tools\Arr::sortBy()` // Sorts the array with the given callback and retains the original key, support multi-column sorting.
    - `\Yiranzai\Tools\Arr::arrSortByField()` // dyadic array sorting
    - `\Yiranzai\Tools\Arr::arrGroup()` // Arrays are grouped by field
    - `\Yiranzai\Tools\Arr::heapSort()` // Heap Sort
    - `\Yiranzai\Tools\Arr::mergeSort()` // Merge Sort
    - `\Yiranzai\Tools\Arr::quickSort()` // Quick Sort
- `Date::class`
    - `\Yiranzai\Tools\Date::toCarbon()` // Generate a Carbon object
    - `\Yiranzai\Tools\Date::timeDiffFormat()` // Output the gap between two DateTime objects
- `Math::class`
    - `\Yiranzai\Tools\Math::formatDiv()` // rounding format division
    - `\Yiranzai\Tools\Math::formatMod()` // rounded out formatted remainder (modulo operation)
    - `\Yiranzai\Tools\Math::formatMul()` // rounding format multiplication
    - `\Yiranzai\Tools\Math::formatSub()` // rounding format subtraction
    - `\Yiranzai\Tools\Math::formatAdd()` // rounding up formatting addition
    - `\Yiranzai\Tools\Math::gcd()` // Find the greatest common divisor of two numbers
    - `\Yiranzai\Tools\Math::gcdArray()` // Find the greatest common divisor of an array
- `Filesystem::class`
    - `\Yiranzai\Tools\Filesystem::put()` // Store contents in the file.
    - `\Yiranzai\Tools\Filesystem::get()` // Get the contents of a file.
- `Tools::class`
    - `\Yiranzai\Tools\Tools::getNiceFileSize()` // Humanized conversion memory information
    - `\Yiranzai\Tools\Tools::callFunc()` // Method of calling the object
    - `\Yiranzai\Tools\Tools::iteratorGet()` // Get an object or an array of elements
    - `\Yiranzai\Tools\Tools::arrGet()` // Get an element in the array
    - `\Yiranzai\Tools\Tools::objectGet()` // Get an element from the object
- `SnowFlake::class`
    - `\Yiranzai\SnowFlake\SnowFlake::next()` // generate 64 bit identifier
    - `\Yiranzai\SnowFlake\SnowFlake::analysis()` // analysis 64 bit identifier
- `Zval::class`
    - `Zval::isRef()` // Determine if two variables have a reference relationship

Change log
----------

[](#change-log)

Please see [CHANGELOG](docs/CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](docs/CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](docs/CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [yiranzai](https://github.com/yiranzai)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](docs/LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

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

Recently: every ~51 days

Total

7

Last Release

2450d ago

Major Versions

v0.2.2 → v1.0.02019-10-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/131c451d3fbf74a922387ce2b4c1e0e2e282afcabe8f67a09fc9fa25bbb09799?d=identicon)[yiranzai](/maintainers/yiranzai)

---

Top Contributors

[![yiranzai](https://avatars.githubusercontent.com/u/20548510?v=4)](https://github.com/yiranzai "yiranzai (16 commits)")

---

Tags

helpersphptoolstoolsyiranzai

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/yiranzai-tools/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[civicrm/civicrm-core

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

751284.3k37](/packages/civicrm-civicrm-core)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.1k4.9k](/packages/shlinkio-shlink)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

53675.5k16](/packages/solspace-craft-freeform)

PHPackages © 2026

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