PHPackages                             wazsmwazsm/kit - 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. wazsmwazsm/kit

ActiveLibrary

wazsmwazsm/kit
==============

common kit

v1.0(7y ago)0271MITPHPPHP &gt;=5.5

Since May 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/wazsmwazsm/Kit)[ Packagist](https://packagist.org/packages/wazsmwazsm/kit)[ Docs](https://github.com/wazsmwazsm/Kit)[ RSS](/packages/wazsmwazsm-kit/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

Kit
===

[](#kit)

[![Build Status](https://camo.githubusercontent.com/091a8c1149c4f8f4b0e42da5432940cbea00aafa2122dacf6378795ac657f89d/68747470733a2f2f7472617669732d63692e6f72672f77617a736d77617a736d2f4b69742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/wazsmwazsm/Kit)

工具箱，包含一些常用工具。

安装
--

[](#安装)

```
composer require wazsmwazsm/kit
```

工具
--

[](#工具)

### DotArr

[](#dotarr)

用 a.b.c 格式的字符串作为数组的路径存储一个值。

设置：

```
use Kit\DotArr;

$arr = [];
DotArr::dotSet($arr, 'foo.bar', 'hello');

var_dump($arr); // result is ['foo' => ['bar' => 'hello']]
```

读取：

```
use Kit\DotArr;

$arr = ['foo' => ['bar' => 'hello']];
$result = DotArr::dotGet($arr, 'foo.bar');

var_dump($result); // result is hello

$result = DotArr::dotGet($arr, 'foo');

var_dump($result); // result is ['bar' => 'hello']

// 获取值不存在返回默认值
$result = DotArr::dotGet($arr, 'a.b', 'd');

var_dump($result); // result is d
```

判断值是否存在：

```
use Kit\DotArr;

$arr = ['foo' => ['bar' => 'hello']];
$result = DotArr::dotHas($arr, 'foo.bar');
var_dump($result); // result is true
$result = DotArr::dotHas($arr, 'a.b');
var_dump($result); // result is false
```

自定义分隔符：

```
use Kit\DotArr;

DotArr::setOperator('/');
$arr = [];
DotArr::dotSet($arr, 'foo/bar', 'hello');
$result = DotArr::dotGet($arr, 'foo/bar');
var_dump($result); // result is hello
```

### Pipeline

[](#pipeline)

管道模式，将载荷送入管道，流过每一节管道，返回结果。

使用：

```
use Kit\Pipeline;

$pipes = [
    function($payload) {
        return $payload + 1;
    },
    function($payload) {
        return $payload + 2;
    },
    function($payload) {
        return $payload + 3;
    },
];
// 初始化时设置管道
$pipe = new Pipeline($pipes);
// 添加管道
$pipe->pipe(function($payload) {
    return $payload + 4;
});

// 运行管道
$result = $pipe->flow(12);

var_dump($result); // result is 22
```

License
-------

[](#license)

The Kit is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

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

2559d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1cb744ac19bc2026bcef320758ee2fc6e40b8291f6d56c866a3438c11551b813?d=identicon)[wazsmwazsm](/maintainers/wazsmwazsm)

---

Top Contributors

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

---

Tags

pipelinekitdotarr

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wazsmwazsm-kit/health.svg)

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

###  Alternatives

[league/pipeline

A plug and play pipeline implementation.

1.0k16.0M74](/packages/league-pipeline)[cakephp/debug_kit

CakePHP Debug Kit

86514.0M136](/packages/cakephp-debug-kit)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[mpociot/pipeline

Simple PHP middleware pipeline

1381.6M12](/packages/mpociot-pipeline)[pipedrive/pipedrive

Pipedrive REST client for PHP

601.2M](/packages/pipedrive-pipedrive)[chefhasteeth/pipeline

18049.5k1](/packages/chefhasteeth-pipeline)

PHPackages © 2026

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