PHPackages                             initphp/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. initphp/container

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

initphp/container
=================

Simple Dependencies Container following PSR-11 standards

0.4(2y ago)11071MITPHPPHP &gt;=7.4

Since Jun 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/InitPHP/Container)[ Packagist](https://packagist.org/packages/initphp/container)[ RSS](/packages/initphp-container/feed)WikiDiscussions main Synced 1mo ago

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

InitPHP Dependencies Container
==============================

[](#initphp-dependencies-container)

Simple Dependencies Container following PSR-11 standards.

*Note :* This is a pre-release version of the library currently available. Report potential bugs and feature requests to the issue section of this repo.

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- [PSR-11 Container Interface Package](https://packagist.org/packages/psr/container) 2.0.2

Installation
------------

[](#installation)

```
composer require initphp/container:dev-main

```

Usage
-----

[](#usage)

Check the `Example` directory for an example usage.

```
require_once "vendor/autoload.php";
use InitPHP\Container\Container;

class UserModel
{
    private string $name;

    public function set(string $name)
    {
        $this->name = $name;
    }

    public function get()
    {
        return $this->name ?? null;
    }
}

class User
{
    private $model;

    public function __construct(UserModel $model)
    {
        $this->model = $model;
    }

    public function getModel()
    {
        return $this->model;
    }
}

$container = new Container();
$user = $container->get(\Example\User::class);
$model = $user->getModel();
$model->set('Muhammet');
echo $user->getModel()->get();
```

Contributing
------------

[](#contributing)

> All contributions to this project will be published under the MIT License. By submitting a pull request or filing a bug, issue, or feature request, you are agreeing to comply with this waiver of copyright interest.

1. Fork it (  )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am "Add some feature")
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request

Credits
-------

[](#credits)

- [Muhammet ŞAFAK](https://www.muhammetsafak.com.tr) &lt;&gt;

License
-------

[](#license)

Copyright © 2022 [MIT License](./LICENSE)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

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

Total

3

Last Release

877d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b6b34f3ac8938d8ee52ba3bd260680855dc5715c7b2929d9380de30d15a67dd?d=identicon)[muhammetsafak](/maintainers/muhammetsafak)

---

Top Contributors

[![muhammetsafak](https://avatars.githubusercontent.com/u/104234499?v=4)](https://github.com/muhammetsafak "muhammetsafak (6 commits)")

---

Tags

containerphpphp7psr-11psr-container

### Embed Badge

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

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

###  Alternatives

[pimple/pimple

Pimple, a simple Dependency Injection Container

2.7k130.5M1.4k](/packages/pimple-pimple)[league/container

A fast and intuitive dependency injection container.

86387.8M343](/packages/league-container)[lctrs/psalm-psr-container-plugin

Let Psalm understand better psr11 containers

17648.1k13](/packages/lctrs-psalm-psr-container-plugin)[phpwatch/simple-container

A fast and minimal PSR-11 compatible Dependency Injection Container with array-syntax and without auto-wiring

1810.1k2](/packages/phpwatch-simple-container)

PHPackages © 2026

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