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

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

rudra/container
===============

Rudra framework

v26.7(1w ago)12.7k11MPL-2.0PHPPHP ^8.3CI passing

Since Jun 27Pushed 1w ago1 watchersCompare

[ Source](https://github.com/Jagepard/Rudra-Container)[ Packagist](https://packagist.org/packages/rudra/container)[ RSS](/packages/rudra-container/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (6)Versions (7)Used By (11)

[![Build Status](https://camo.githubusercontent.com/b0b3c5adfdd4e6231e520b40163111f632ec7ac5285d5e10f3927a7bbdece020/68747470733a2f2f7472617669732d63692e6f72672f4a616765706172642f52756472612d436f6e7461696e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Jagepard/Rudra-Container)[![Maintainability](https://camo.githubusercontent.com/8c961add9efd854d8c05f9b31ae3810f8873e574108a9d4d5ab752b0729cc092/68747470733a2f2f716c74792e73682f6261646765732f36616238346239312d386631382d343039662d623335302d6238663861333765323738632f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/Jagepard/projects/Rudra-Container)[![CodeFactor](https://camo.githubusercontent.com/f0203bb309bea9bb2943dafebc7e51b38556ce99368cb6563a2b0e131fec1d3a/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6a616765706172642f72756472612d636f6e7461696e65722f6261646765)](https://www.codefactor.io/repository/github/jagepard/rudra-container)[![Coverage Status](https://camo.githubusercontent.com/bc4d3a72cc772eae627de858771cfdecdee59d8afdb22d53278c85852c779c8b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a616765706172642f52756472612d436f6e7461696e65722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Jagepard/Rudra-Container?branch=master)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

Rudra-Container | [API](https://github.com/Jagepard/Rudra-Container/blob/master/docs.md "Documentation API")
============================================================================================================

[](#rudra-container--api)

#### Installation

[](#installation)

`composer require rudra/container`

#### Using

[](#using)

```
use Rudra\Container\Rudra;

Rudra::run();
```

using Facade:

```
use Rudra\Container\Facades\Rudra;
```

---

##### Setting:

[](#setting)

---

Bind an interface to an implementation or pre-arranged factory:
---------------------------------------------------------------

[](#bind-an-interface-to-an-implementation-or-pre-arranged-factory)

```
Rudra::run()->binding([
    SomeInterface::class => SomeClass::class
    ...
    SomeInterface::class => SomeFactory::class
    ...
    SomeInterface::class => 'service-name'
    ...
    SomeInterface::class => function (){
        return new SomeClass();
    }
    ...
    SomeInterface::class => function (){
        return (new SomeFactory)->create();
    }
]);
```

using Facade:

```
Rudra::binding([
    SomeInterface::class => SomeClass::class
    ...
    SomeInterface::class => SomeFactory::class
    ...
    SomeInterface::class => 'service-name'
        ...
    SomeInterface::class => function (){
        return new SomeClass();
    }
    ...
    SomeInterface::class => function (){
        return (new SomeFactory)->create();
    }
]);
```

---

Installs services into a waiting container to be initialized when called:
-------------------------------------------------------------------------

[](#installs-services-into-a-waiting-container-to-be-initialized-when-called)

```
Rudra::run()->waiting([
    'service-name' => [SomeClass::class, ['param-1', 'param-2']]
    ...
    'service-name' => SomeFactory::class
    ...
    'service-name' => function (){
        return new SomeClass();
    }
    ...
     'service-name' => function (){
        return (new SomeFactory)->create();
    }
}
])
```

using Facade:

```
Rudra::waiting([
    'service-name' => [SomeClass::class, ['param-1', 'param-2']]
    ...
    'service-name' => SomeFactory::class
    ...
    'service-name' => function (){
        return new SomeClass();
    }
    ...
     'service-name' => function (){
        return (new SomeFactory)->create();
    }
}
])
```

---

Add a bind to previously established ones:
------------------------------------------

[](#add-a-bind-to-previously-established-ones)

```
Rudra::run()->binding()->set([SomeInterface::class => SomeClass::class])
```

using Facade:

```
Rudra::binding()->set([SomeClass::class, ['param-1', 'param-2']);
```

---

Add the service to the previously installed ones:
-------------------------------------------------

[](#add-the-service-to-the-previously-installed-ones)

```
Rudra::run()->waiting()->set([
    'service-name' => [SomeClass::class, ['param-1', 'param-2']]
    ...
    'service-name' => SomeFactory::class
])
```

using Facade:

```
Rudra::waiting()->set([
    'service-name' => [SomeClass::class, ['param-1', 'param-2']]
    ...
    'service-name' => SomeFactory::class
])
```

---

Call the created service:
-------------------------

[](#call-the-created-service)

```
Rudra::run()->get('service-name')
```

using Facade:

```
Rudra::get('service-name')
```

---

If the service does not have parameters, or the parameters are in the binding, then the service will be created automatically when calling
------------------------------------------------------------------------------------------------------------------------------------------

[](#if-the-service-does-not-have-parameters-or-the-parameters-are-in-the-binding-then-the-service-will-be-created-automatically-when-calling)

```
Rudra::run()->get(Service::class)
```

using Facade:

```
Rudra::get(Service::class)
```

License
-------

[](#license)

This project is licensed under the **Mozilla Public License 2.0 (MPL-2.0)** — a free, open-source license that:

- Requires preservation of copyright and license notices,
- Allows commercial and non-commercial use,
- Requires that any modifications to the original files remain open under MPL-2.0,
- Permits combining with proprietary code in larger works.

📄 Full license text: [LICENSE](./LICENSE)
🌐 Official MPL-2.0 page:

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance98

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity56

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

Every ~90 days

Total

5

Last Release

10d ago

Major Versions

v25.12 → v26.12025-12-26

PHP version history (2 changes)v25.6PHP &gt;=8.3

v26.7PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/75e65761bdd94035d1c783773a706d5722ce3164fe55d9722581c2cb4a642d8c?d=identicon)[jagepard](/maintainers/jagepard)

---

Top Contributors

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

---

Tags

containerdependency-injectiondependency-injection-containerioc-containerrudracontainerdependency-injectionrudradependency injection containerioc-container

### Embed Badge

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

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

###  Alternatives

[pimple/pimple

Pimple, a simple Dependency Injection Container

2.7k134.5M1.4k](/packages/pimple-pimple)[aura/di

A serializable dependency injection container with constructor and setter injection, interface and trait awareness, configuration inheritance, and much more.

356990.6k60](/packages/aura-di)[mrclay/props-dic

Props is a simple DI container that allows retrieving values via custom property and method names

3512.7M3](/packages/mrclay-props-dic)[godruoyi/easy-container

A small PHP 5.3 dependency injection container extended from Laravel container.

335.0k3](/packages/godruoyi-easy-container)[infocyph/intermix

A lightweight PHP DI container, invoker, serializer, and utility toolkit.

137.7k2](/packages/infocyph-intermix)

PHPackages © 2026

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