PHPackages                             elegenceio/containers - 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. elegenceio/containers

ActiveLibrary

elegenceio/containers
=====================

Core Container Package for lazarusphp FrameWork

1.0.0(today)03↑2900%PHP

Since Jul 30Pushed todayCompare

[ Source](https://github.com/elegenceIO/Containers)[ Packagist](https://packagist.org/packages/elegenceio/containers)[ RSS](/packages/elegenceio-containers/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

ElegenceIO Container.
=====================

[](#elegenceio-container)

What it is?
-----------

[](#what-it-is)

elegence io continer package is a core package designed to register content and load it in a global state.

How to use
----------

[](#how-to-use)

**installation**

```
composer require elegenceIO/containers

// or

git clone https://github.com/elegenceIO/Container
```

**instantiation**

```
use ElegenceIO\Containers\Container;
use ElegenceIO\Containers\ContainerRegistry;

function app(){
$container = new Container();
// make static access
ContainerRegistry::set($container);

// Returns the container
return $container
}
```

**Bindings**

- `map()`
    - used for Mapping a container Referene
    - Supports strings Integers arrays and callables
    - Ideal for Mapping config files.
- `bind()`
    - used to map a new instance when called.
    - must be callable using function() or fn()
- `simgleton()`
    - used to map a single persistant reference
    - must be callable using function() or fn()

**options**

- `locked()`
    - can be used to map an interface to a class
- `alias()`provides the ability to map an alias to a class.

Example Usage
-------------

[](#example-usage)

**Creating and Instance**

```
app()->map(Database::class,new Database());
```

the following example works for both singleton and bind

```
app()->bind("db",function()
{
    $db = new Database(//Include config file or array data\/);
    return $db;
})

// Optionally

app()->bind("db",fn()=> new Database("config.php"));
```

Returning a container this will activate the container s

```
app()->get("db");
```

**Adding Aliases**

```
app()->bind(Database::class,function()
{
    $db = new Database(//Include config file or array data\/);
    return $db;
})->alias("database")->alias

// Want to alias an alias this can be done like to

app()->alias("db2","database");
// Both db2 and database will work as alias files
```

**Locking Interface**Currently this only supports locking one interface, however this can be accomplished like so.

```
app()->bind("db",function()
{
    $db = new Database(//Include config file or array data\/);
    return $db;
})->locked(Connection::class);
```

`locked()` and `alias()` method can be usentogether format;

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance100

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/42fe8da43e075694b07eeec0a2fb822ab60aa872bf765cb0434b919b43264479?d=identicon)[mbamber1986](/maintainers/mbamber1986)

---

Top Contributors

[![itzzpadre](https://avatars.githubusercontent.com/u/30671636?v=4)](https://github.com/itzzpadre "itzzpadre (9 commits)")

### Embed Badge

![Health badge](/badges/elegenceio-containers/health.svg)

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[laravel/framework

The Laravel Framework.

34.8k543.8M20.6k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k17](/packages/tempest-framework)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k54](/packages/ecotone-ecotone)[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

187557.3k3](/packages/wikimedia-parsoid)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)

PHPackages © 2026

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