PHPackages                             wilkques/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wilkques/container

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wilkques/container
==================

v4.0.2(12mo ago)05126MITPHPPHP &gt;=5.3

Since Oct 19Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/wilkques/php-container)[ Packagist](https://packagist.org/packages/wilkques/container)[ RSS](/packages/wilkques-container/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (14)Used By (6)

Container
=========

[](#container)

[![Latest Stable Version](https://camo.githubusercontent.com/30ecbf5d60129d2a4de954d6a20e706baede74764cd5000e178cf80466b596c3/68747470733a2f2f706f7365722e707567782e6f72672f77696c6b717565732f636f6e7461696e65722f762f737461626c65)](https://packagist.org/packages/wilkques/container)[![License](https://camo.githubusercontent.com/949642ac6c147c3cfbfa0bf994be8c6ebffeea387efca4c4e441a7bb0812f498/68747470733a2f2f706f7365722e707567782e6f72672f77696c6b717565732f636f6e7461696e65722f6c6963656e7365)](https://packagist.org/packages/wilkques/container)

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

[](#how-to-use)

`composer require wilkques/container`

```
require '/vendor/Container/src/helpers.php';
require '/vendor/Container/src/Container.php';
```

Method
------

[](#method)

1. `register`

    ```
    container()->register(
    '',
    new ''
    );

    // or

    container()->register([
    	[
    		'',
    		new ''
    	],
    	[
    		'',
    		new ''
    	],

    	...
    ]);
    ```
2. `bind`

    ```
    $abstract = new \Your\Class\Name;

    container()->bind('', function () use ($abstract) {
    	return $abstract;
    });
    ```
3. `singleton`The singleton method binds a class or interface into the container that should only be resolved one time. Once a singleton binding is resolved, the same object instance will be returned on subsequent calls into the container:

    ```
    $abstract = new \Your\Class\Name;

    container()->singleton('', function () use ($abstract) {
    	return $abstract;
    });
    ```
4. `scoped`

    ```
    $abstract = new \Your\Class\Name;

    container()->scoped('', function () use ($abstract) {
    	return $abstract;
    });
    ```
5. `get`

    ```
    container()->get('');
    ```
6. `make`

    ```
    container('');

    // or

    container()->make('');
    ```
7. `call`

    ```
    container()->call(['', ''], ['' => '']);

    // or

    container()->call([new '', ''], ['' => '']);

    // or

    container()->call(function (\Your\Class\Name $abstract) {
    	// do something
    });
    ```
8. `forgetScopedInstances`Clear all of the scoped instances from the container.
9. `forgetInstance`

    ```
    container()->forgetInstance('');
    ```
10. `forgetInstances`Clear all of the instances from the container.
11. `flush`Flush the container of all bindings and resolved instances.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance50

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

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

Recently: every ~169 days

Total

13

Last Release

364d ago

Major Versions

v0.0.2 → v1.1.32022-08-05

v1.1.4 → v2.0.42023-05-25

v2.0.4 → v3.0.02023-05-31

v3.0.3 → v4.0.02024-09-25

PHP version history (2 changes)v0.0.0PHP &gt;=5.4

v2.0.4PHP &gt;=5.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/906e907ec7e3dbe49f32aebd0f36488176d3736a65d38675753ba9a6a21017b6?d=identicon)[wilkques](/maintainers/wilkques)

---

Top Contributors

[![wilkques](https://avatars.githubusercontent.com/u/51186879?v=4)](https://github.com/wilkques "wilkques (29 commits)")

### Embed Badge

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

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

###  Alternatives

[barracudanetworks/forkdaemon-php

A library to make setup and management of forking daemons in PHP easy.

3863.8k2](/packages/barracudanetworks-forkdaemon-php)

PHPackages © 2026

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