PHPackages                             veasin/nx-container - 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. veasin/nx-container

ActiveFramework

veasin/nx-container
===================

Container for nx

0.0.1(2y ago)046PHPPHP &gt;=8.2

Since Nov 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/veasin/nx-container)[ Packagist](https://packagist.org/packages/veasin/nx-container)[ Docs](https://github.com/veasin/nx-container)[ RSS](/packages/veasin-nx-container/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

nx-container
============

[](#nx-container)

container for nx

Installation
------------

[](#installation)

> composer require urn2/nx-container

Usage
-----

[](#usage)

```
use nx\Container;
$container =new Container();

$container['int']=123;
$container['string']='123';
$container['instance']=fn()=>new \Radis();//获取时构建 shared 只在获取时候构建一次 否则每次
$container['obj']=$this;

//service方法 每次返回都不同
$container['some.service'] =$container->service(fn()=>new "Some Factory Function"(), shared:false);
//method方法 可多次执行
$container['some.method'] =$container->method(fn($s)=>echo $s);
$container['some.method']('123');
//set方法
$container['parameter'] =$container->set([
    //'type'=>'value',
    'value'=>123,
    'shared'=>true,
]);
$container['service'] =$container->set([
    //'type'=>'service',
    'class'=>$container->ref('key'),//'%key%',//应支持一次读取 或 转换成对象(函数)
    'args'=>[1,2,3],
    'shared'=>false,
]);
$container['method'] =$container->set([
    //'type'=>'method',
    'method'=>fn($s)=>echo $s,
    'shared'=>true,
]);
```

###  Health Score

21

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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

871d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/veasin-nx-container/health.svg)

```
[![Health](https://phpackages.com/badges/veasin-nx-container/health.svg)](https://phpackages.com/packages/veasin-nx-container)
```

###  Alternatives

[akrabat/ip-address-middleware

PSR-15 middleware that determines the client IP address and stores it as a ServerRequest attribute

1702.4M15](/packages/akrabat-ip-address-middleware)[internal/dload

Downloads binaries.

97124.8k6](/packages/internal-dload)

PHPackages © 2026

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