PHPackages                             plugin-master/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. [Framework](/categories/framework)
4. /
5. plugin-master/container

ActiveLibrary[Framework](/categories/framework)

plugin-master/container
=======================

The PluginMaster DI Container.

1.0.0(3y ago)08MITPHPPHP ^8.0

Since Jun 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/WP-PluginMaster/container)[ Packagist](https://packagist.org/packages/plugin-master/container)[ Docs](https://github.com/WP-Plugin-Master/PluginMaster-Foundation)[ RSS](/packages/plugin-master-container/feed)WikiDiscussions main Synced yesterday

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

Simplified Dependency Injection Container For PluginMaster (Or any PHP project)
-------------------------------------------------------------------------------

[](#simplified-dependency-injection-container-for-pluginmaster-or-any-php-project)

##### Simplified dependency injection container for PHP project. We create this package for PluginMaster(WordPress Plugin Development Framework)

[](#simplified-dependency-injection-container-for-php-project-we-create-this-package-for-pluginmasterwordpress-plugin-development-framework)

*Dependency Injection Containers are mainly used for managing the dependencies required by classes and their methods. When we need to create an instance of a class or call a method of a class, a container helps us deal with these dependencies smoothly.*

**I've developed this new PHP container with the goal of streamlining and simplifying dependency management. The functions it provides:**

1. **get:** This function allows you to retrieve an instance of a class or an alias that's already been defined.
2. **make:** for creating a new instance of a class, using any necessary parameter also it will replace resolved objects that created with provided class name.
3. **call:** To invoke a method of a class. It can take callable arguments in various formats like

    a. `[class::class, 'method']`
    b. `[new class(), 'method']`
    c. `'class@method'`
    d. `class::class` ( will fire \_invoke method).
4. **set:** Assigns an alias to a class or a callback function. has: Checks if the container has resolved a certain class or alias.

In short, I developed this new PHP container to simplify dependency management, making it more accessible and straightforward, especially for projects that don't require more advanced features.

#### Install Package:

[](#install-package)

```
composer require plugin-master/container
```

Example:

```

$container = new \PluginMaster\Container\Container();

```

#### 1. Set Alias

[](#1-set-alias)

```

$container->set('User', function () {
    return new User();
});

```

#### 2. Get Alias

[](#2-get-alias)

```
$user = $container->get('User') ;

```

#### 3. Call A method of class or callback function

[](#3-call-a-method-of-class-or-callback-function)

```
$container->call('Project@user', ['name' => 'PHP IS POWER' ]);

```

```
 $container->call('Project#user', ['name' => 'AL EMRAN' ], ['methodSeparator'=>'#']);

```

```
$container->call([Project::class, 'user'], ['name' => 'AL EMRAN' ]);

```

#### 4. Make A Object from Class

[](#4-make-a-object-from-class)

```
$project = $container->make(Project::class, ['name' => 'Make User' ]);

```

```
$user = $container->make(User::class);

```

#### 5. get Object from provided class

[](#5-get-object-from-provided-class)

```
$user = $container->get(User::class);

```

#### 6. Check Resolved Object or alias exist

[](#6-check-resolved-object-or-alias-exist)

```
$user = $container->has(User::class);

```

### Test

[](#test)

### 1. Clone Repo

[](#1-clone-repo)

```
git clone https://github.com/WP-PluginMaster/container.git
```

#### 2. Install Dependency

[](#2-install-dependency)

```
composer install
```

#### 3. Run Index.php file

[](#3-run-indexphp-file)

```
php Index.php
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

1111d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1bc29c6227fdfa1f1980c440796e0aa8f249c549be4a75c772c2c67102f5ae4b?d=identicon)[alemran](/maintainers/alemran)

---

Top Contributors

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

---

Tags

WordPress Plugin Development frameworkPlugin Master

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[symfony/symfony

The Symfony PHP framework

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

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[bref/bref

Bref is a framework to write and deploy serverless PHP applications on AWS Lambda.

3.4k10.6M67](/packages/bref-bref)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

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