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 1mo ago

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 19% 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

918d 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

[pimple/pimple

Pimple, a simple Dependency Injection Container

2.7k130.5M1.4k](/packages/pimple-pimple)[neos/flow

Flow Application Framework

862.0M449](/packages/neos-flow)[api-platform/state

API Platform state interfaces

223.4M57](/packages/api-platform-state)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[symfony/json-streamer

Provides powerful methods to read/write data structures from/into JSON streams.

14440.0k8](/packages/symfony-json-streamer)[rubix/server

Deploy your Rubix ML models to production with scalable stand-alone inference servers.

632.3k](/packages/rubix-server)

PHPackages © 2026

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