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.1(4mo ago)12.3k11MPL-2.0PHPPHP &gt;=8.3CI failing

Since Jun 27Pushed 4mo ago1 watchersCompare

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

READMEChangelog (4)Dependencies (3)Versions (5)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
Связать интерфейс с реализацией или заранее подготовленной фабрикой:

---

```
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:
Устанавливает сервисы в контейнер ожидающих, для инициализации при вызове:

---

```
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:
Добавляем привязку к ранее установленным:

---

```
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:
Добавляем сервис к ранее установленным:

---

```
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:
Вызываем созданный сервис:

---

```
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
Если сервис не имеет параметров, либо параметры имеются в привязке, то сервис будет создан автоматически при вызове

---

```
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:

---

Проект распространяется под лицензией **Mozilla Public License 2.0 (MPL-2.0)**. Это означает:

- Вы можете свободно использовать, изменять и распространять код.
- При изменении файлов, содержащих исходный код из этого репозитория, вы обязаны оставить их открытыми под той же лицензией.
- Вы **обязаны сохранять уведомления об авторстве** и ссылку на оригинал.
- Вы можете встраивать код в проприетарные проекты, если исходные файлы остаются под MPL.

📄 Полный текст лицензии (на английском): [LICENSE](./LICENSE)
🌐 Официальная страница:

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance76

Regular maintenance activity

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity54

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

Total

4

Last Release

143d ago

Major Versions

v25.12 → v26.12025-12-26

### 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 (687 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.7k130.5M1.4k](/packages/pimple-pimple)[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[aura/di

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

356968.3k58](/packages/aura-di)[mrclay/props-dic

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

3611.7M3](/packages/mrclay-props-dic)[acclimate/container

Provides adapters for various third-party service containers.

219390.6k15](/packages/acclimate-container)[godruoyi/easy-container

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

334.9k2](/packages/godruoyi-easy-container)

PHPackages © 2026

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