Skip to content

Latest commit

 

History

History
107 lines (82 loc) · 4.04 KB

README_ZH_CN.md

File metadata and controls

107 lines (82 loc) · 4.04 KB

php-tools

ENGLISH | 中文

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

php 常用工具

目录

src/
tests/

安装

Via Composer

$ composer require yiranzai/tools

使用

更多请查看用户手册

摘要

  • Arr::class
    • \Yiranzai\Tools\Arr::sortBy() // 使用给定的回调对数组进行排序并保留原始键
    • \Yiranzai\Tools\Arr::arrSortByField() // 二维数组排序
    • \Yiranzai\Tools\Arr::arrGroup() // 数组按字段分组
    • \Yiranzai\Tools\Arr::heapSort() // 堆排序
    • \Yiranzai\Tools\Arr::mergeSort() // 归并排序
    • \Yiranzai\Tools\Arr::quickSort() // 快速排序
  • Date::class
    • \Yiranzai\Tools\Date::toCarbon() // 生成 Carbon 对象
    • \Yiranzai\Tools\Date::timeDiffFormat() // 输出两个 DateTime 对象的差距
  • Math::class
    • \Yiranzai\Tools\Math::formatDiv() // 四舍五入 格式化除法
    • \Yiranzai\Tools\Math::formatMod() // 四舍五入 格式化取余(模运算)
    • \Yiranzai\Tools\Math::formatMul() // 四舍五入 格式化乘法
    • \Yiranzai\Tools\Math::formatSub() // 四舍五入 格式化减法
    • \Yiranzai\Tools\Math::formatAdd() // 四舍五入 格式化加法
    • \Yiranzai\Tools\Math::gcd() // 求两个数的最大公约数
    • \Yiranzai\Tools\Math::gcdArray() // 求一个数组的最大公约数
  • Filesystem::class
    • \Yiranzai\Tools\Filesystem::put() // 将内容存储在文件中。
    • \Yiranzai\Tools\Filesystem::get() // 获取文件的内容。
  • Tools::class
    • \Yiranzai\Tools\Tools::getNiceFileSize() // 人性化转化内存信息
    • \Yiranzai\Tools\Tools::callFunc() // 调用对象的方法
    • \Yiranzai\Tools\Tools::iteratorGet() // 获取一个对象或者一个数组的属性
    • \Yiranzai\Tools\Tools::arrGet() // 获取数组中的某个元素
    • \Yiranzai\Tools\Tools::objectGet() // 获取对象中的某个元素
  • SnowFlake::class
    • \Yiranzai\SnowFlake\SnowFlake::next() // 生成 64 位 id
    • \Yiranzai\SnowFlake\SnowFlake::analysis() // 解析 64 位 id
  • Zval::class
    • Zval::isRef() // 确定两个变量是否具有引用关系

Change log

Please see CHANGELOG for more information on what has changed recently.

测试

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

安全

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

Credits

License

The MIT License (MIT). Please see License File for more information.