PHPackages                             nsp-team/common-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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. nsp-team/common-tools

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

nsp-team/common-tools
=====================

Common tool library components

v0.0.2(4y ago)317Apache-2.0PHPPHP &gt;=7.3.0

Since Jan 11Pushed 4y agoCompare

[ Source](https://github.com/nsp-team/common-tools)[ Packagist](https://packagist.org/packages/nsp-team/common-tools)[ RSS](/packages/nsp-team-common-tools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

**nsp-team/common-tools** 是一个非常小的工具库，尽可能的为我们创建的最简单和最有用的 API。

- 说明

> 满足日常开发中的常用的工具方法，立志于降低相关API的学习成本，提高工作效率。 它节省了开发人员对项目中公用类和公用工具方法的封装时间，使开发专注于业务。

Install
-------

[](#install)

```
composer require nsp-team/common-tools
```

Simple usage
------------

[](#simple-usage)

```
MiniProgram::instance()
    ->setAccessToken('52_jW7tLxhmlcFqeiA_wDVC-CjcSAOAbAFADRD')
    ->ocr()
    ->idcard('https://xxx/65bee3c9-b972-4fb7-9dfe-9c4b9e7a8e.jpg');

var_dump(FileUtil::getExtension('/www/htdocs/inc/lib.inc.php'));
var_dump(FileUtil::getFilenameNoExtension('/www/htdocs/inc/lib.inc.php'));
var_dump(FileUtil::getFilenameWithExtension('/www/htdocs/inc/lib.inc.php'));

$arr = json_decode('{
			"my_follower_count": "1",
			"my_devices_count": "1",
			"my_other_followers_count": 0,
			"currentUser": {
				"device_id": "77",
				"actual_user_id": "283",
				"auth_code": "22560",
			},
			"users": [{
				"device_id": "77",
				"actual_user_id": "283",
				"birthday": "",
				"auth_code": "22560",
			}, {
				"device_id": "72",
				"actual_user_id": "269",
				"birthday": "2021-11-26",
				"auth_code": "0",
			}]
		}');
$collection = \NspTeam\Component\Tools\Collection::make($arr);

var_dump(\NspTeam\Component\Tools\Utils\ArrayUtil::camel($collection->toArray()));
```

命名规范
----

[](#命名规范)

遵循PSR-2命名规范和PSR-4自动加载规范。

文档
--

[](#文档)

后期我会提供一份教程文档使用方式，开发者可以先自定阅读源码。

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Total

2

Last Release

1584d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

psrtools

### Embed Badge

![Health badge](/badges/nsp-team-common-tools/health.svg)

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

###  Alternatives

[psr/container

Common Container Interface (PHP FIG PSR-11)

10.0k1.0B3.7k](/packages/psr-container)[psr/clock

Common interface for reading the clock.

642332.9M343](/packages/psr-clock)[lctrs/psalm-psr-container-plugin

Let Psalm understand better psr11 containers

17648.1k13](/packages/lctrs-psalm-psr-container-plugin)[mayflower/mo4-coding-standard

PHP CodeSniffer ruleset implementing the MO4 coding standards extending the Symfony coding standards.

17508.3k5](/packages/mayflower-mo4-coding-standard)

PHPackages © 2026

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