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

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

blockify/container
==================

Blockify container package.

082PHP

Since May 16Pushed 2y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Blockify Container
==================

[](#blockify-container)

Simple PHP dependency injection container with autowiring for WordPress plugins and themes.

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

[](#installation)

```
composer require blockify/container
```

Usage
-----

[](#usage)

### PHP

[](#php)

First, require Composer's autoloader and then register the container:

```
require_once __DIR__ . '/vendor/autoload.php';

namespace MyNamespace;

use Blockify\Container\Container;
use Blockify\Container\Registerable;

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

$service_providers = [
	MyServiceProvider::class      => [ __FILE__ ],
	AnotherServiceProvider::class => [],
];

foreach ( $service_providers as $service_provider => $args ) {
	$instance = $container->make( $service_provider, ...$args );

	if ( $instance instanceof Registerable ) {
		$instance->register();
	}
}
```

Dependencies will be automatically resolved and injected into the constructor:

```
namespace MyNamespace;

class MyServiceProvider {

	private string $file;

	public function __construct( string $file ) {
		$this->dependency = $dependency;
	}

	public function getFile(): string {
		return $this->file;
	}
}

class AnotherServiceProvider implements Registerable {

	private MyServiceProvider $my_service_provider;

	public function __construct( MyServiceProvider $my_service_provider ) {
		$this->my_service_provider = $my_service_provider;
	}

	public function register() {
		echo $this->my_service_provider->getFile();
	}
}
```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity18

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/baa8d5e8f35d37d8cbce60c8604aede77a961b13311acfbad9a227ccf00e99dc?d=identicon)[blockify](/maintainers/blockify)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[aaronvangeffen/awstatsparser

A series of classes to help read and merge Awstats data files

112.8k](/packages/aaronvangeffen-awstatsparser)[sivka/paginator

bootstrap-4 fork of jasongrimes/php-paginator, a lightweight PHP paginator, for generating pagination controls in the style of Stack Overflow and Flickr. The 'first' and 'last' page links are shown inline as page numbers, and excess page numbers are replaced by ellipses.

141.3k](/packages/sivka-paginator)

PHPackages © 2026

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