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. [Framework](/categories/framework)
4. /
5. veasin/nx-container

ActiveFramework[Framework](/categories/framework)

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 3w 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

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity45

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

963d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/127591812?v=4)[vea](/maintainers/vea)[@Vea](https://github.com/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

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

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