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

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

technically/null-container
==========================

Null (always empty) PSR-11 container implementation

2.0.1(9mo ago)26552MITPHPPHP &gt;=8.0CI passing

Since Feb 24Pushed 9mo ago1 watchersCompare

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

READMEChangelog (5)Dependencies (2)Versions (11)Used By (2)

Technically Null Container
==========================

[](#technically-null-container)

`Technically\NullContainer` is a [PSR-11](https://www.php-fig.org/psr/psr-11/) container implementation that is always empty.

This is a [NullObject](https://en.wikipedia.org/wiki/Null_object_pattern) pattern implementation for PSR-11.

This is useful when you want to provide an optional `ContainerInterface` dependency, but don't want to deal with nullable values.

[![Tests Status](https://github.com/technically-php/null-container/actions/workflows/test.yml/badge.svg)](https://github.com/technically-php/null-container/actions/workflows/test.yml/badge.svg)

Features
--------

[](#features)

- PSR-11
- PHP 8.0+
- Semver
- Tests
- Changelog

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

[](#installation)

Use [Composer](https://getcomposer.org/) package manager to add *NullContainer* to your project:

```
composer require technically/null-container

```

Example
-------

[](#example)

```
use Psr\Container\ContainerInterface;
use Technically\NullContainer\NullContainer;

final class MyServiceContainer implements ContainerInterface
{
    private ContainerInterface $parent;

    /**
     * @param ContainerInterface|null $parent
     */
    public function __construct(ContainerInterface $parent = null)
    {
        $this->parent = $parent ?? new NullContainer();
    }

    // ... your code, where you don't need to deal with $parent set to `null`.
}
```

Changelog
---------

[](#changelog)

All notable changes to this project will be documented in the [CHANGELOG](./CHANGELOG.md) file.

Credits
-------

[](#credits)

- Implemented by [Ivan Voskoboinyk](https://github.com/e1himself?utm_source=web&utm_medium=github&utm_campaign=technically/null-container)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance57

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Recently: every ~404 days

Total

10

Last Release

288d ago

Major Versions

1.1.3 → 2.0.02021-03-31

1.x-dev → 2.0.12025-08-04

PHP version history (3 changes)1.0PHP &gt;=7.0

1.1PHP &gt;=7.1

2.0.0PHP &gt;=8.0

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

containernullnull-objectphppsr-11phpcontainerPSR-11nullpsr containernull-object

### Embed Badge

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

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

###  Alternatives

[devanych/di-container

Simple implementation of a PSR-11 dependency injection container

124.2k3](/packages/devanych-di-container)

PHPackages © 2026

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