PHPackages                             neighborhoods/dependency-injection-container-builder - 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. neighborhoods/dependency-injection-container-builder

ActiveLibrary[Framework](/categories/framework)

neighborhoods/dependency-injection-container-builder
====================================================

A dependency injection container builder based on Symfony.

1.1.3(5y ago)010.2k↓33.9%[1 issues](https://github.com/neighborhoods/DependencyInjectionContainerBuilderComponent/issues)[1 PRs](https://github.com/neighborhoods/DependencyInjectionContainerBuilderComponent/pulls)4proprietaryPHPPHP ^7.3|^8

Since Jan 11Pushed 5y ago2 watchersCompare

[ Source](https://github.com/neighborhoods/DependencyInjectionContainerBuilderComponent)[ Packagist](https://packagist.org/packages/neighborhoods/dependency-injection-container-builder)[ RSS](/packages/neighborhoods-dependency-injection-container-builder/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (8)Versions (7)Used By (4)

Neighborhoods Container Builder
===============================

[](#neighborhoods-container-builder)

Basic example of usage
----------------------

[](#basic-example-of-usage)

```
$container = (new \Neighborhoods\DependencyInjectionContainerBuilderComponent\TinyContainerBuilder())
    ->setContainerBuilder(new \Symfony\Component\DependencyInjection\ContainerBuilder())
    ->setRootPath(dirname(__DIR__))
    ->addSourcePath('src/ComponentName')
    ->addSourcePath('src/Prefab5')
    ->addSourcePath('fab/ComponentName')
    ->makePublic(SomeRepository::class)
    ->addCompilerPass(new \Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass())
    ->addCompilerPass(new \Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass())
    ->build();
```

- `setContainerBuilder`: the setter takes instance of `\Symfony\Component\DependencyInjection\ContainerBuilder`. It's possible to supply non-empty container.
- `setRootPath`: takes the path to the project root (where `src` and `fab` folders are located)
- `addSourcePath`: takes the path to a folder containing definitions for Container Builder
- `makePublic`: takes the service URI (usually class name) and makes it public
- `makeAllPublic`: makes all services public
- `addCompilerPass`: takes instance of `\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface` and supplies it to the `addCompilerPass` method of ContainerBuilder.
- `build`: creates and returns an instance of `\Psr\Container\ContainerInterface`

With Cache
----------

[](#with-cache)

If container needs to be cached, a `\Neighborhoods\DependencyInjectionContainerBuilderComponent\CacheHandlerInterface`can be supplied through `setCacheHandler`.

```
$cacheHandler = (new \Neighborhoods\DependencyInjectionContainerBuilderComponent\SymfonyConfigCacheHandler\Builder())
    ->setName('ContainerName')
    ->setCacheDirPath(dirname(__DIR__) . '/data/cache')
    ->setDebug(true)
    ->build();
$container = (new \Neighborhoods\DependencyInjectionContainerBuilderComponent\TinyContainerBuilder())
    // ...
    ->setCacheHandler($cacheHandler)
    ->build();
```

- `setName`: takes the name of the cached Container class
- `setCacheDirPath`: takes the path to directory where container file is going to be stored (absolute)
- `setDebug`: takes a boolean flag whether "debug mode" should be on or off. When debug mode is on, cache is going to "listen" for the changes in source configuration files. If any change is introduced, cache would be considered invalid, and a new one will be generated and stored. It's advised to use `true` only for development.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.7% 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 ~43 days

Total

5

Last Release

1827d ago

PHP version history (2 changes)1.0.0PHP ^7.3

1.1.2PHP ^7.3|^8

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8584765?v=4)[neighborhoods.com](/maintainers/neighborhoods)[@neighborhoods](https://github.com/neighborhoods)

---

Top Contributors

[![Firtzberg](https://avatars.githubusercontent.com/u/8490119?v=4)](https://github.com/Firtzberg "Firtzberg (14 commits)")[![rhift](https://avatars.githubusercontent.com/u/1008958?v=4)](https://github.com/rhift "rhift (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/neighborhoods-dependency-injection-container-builder/health.svg)

```
[![Health](https://phpackages.com/badges/neighborhoods-dependency-injection-container-builder/health.svg)](https://phpackages.com/packages/neighborhoods-dependency-injection-container-builder)
```

###  Alternatives

[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[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)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)

PHPackages © 2026

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