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(4y ago)09.8k↓50%[1 PRs](https://github.com/neighborhoods/DependencyInjectionContainerBuilderComponent/pulls)4proprietaryPHPPHP ^7.3|^8

Since Jan 11Pushed 4y 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 1mo ago

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 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity52

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

1775d 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

[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[symfony/framework-bundle

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

3.6k235.4M9.7k](/packages/symfony-framework-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

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