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

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

norvica/container
=================

Pragmatic PHP dependency injection container.

v0.4.1(1y ago)013MITPHPPHP &gt;=8.2

Since May 17Pushed 1y agoCompare

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

READMEChangelog (9)Dependencies (3)Versions (10)Used By (0)

Dependency Injection Container
==============================

[](#dependency-injection-container)

[![Latest Stable Version](https://camo.githubusercontent.com/68ea75828f9fd09da8920ea5e7e6d6b60edd19be36004616fe673bc5ad5ee8c6/68747470733a2f2f706f7365722e707567782e6f72672f6e6f72766963612f636f6e7461696e65722f762f737461626c652e706e67)](https://packagist.org/packages/norvica/container)[![Checks](https://github.com/norvica/container/actions/workflows/checks.yml/badge.svg)](https://github.com/norvica/container/actions/workflows/checks.yml)

Simple yet powerful DI container for PHP, with PSR-11 compliance and easy configuration.

Read the [documentation](https://container.norvica.dev).

Important

This library is under active development and is not yet at version `1.0`. While some features or implementation details may change in future updates, the core functionality adheres to the PSR-11 container interface, ensuring compatibility with other PSR-11 compliant components.

Why Choose This Container?
--------------------------

[](#why-choose-this-container)

### Simplicity Empowers Maintainability

[](#simplicity-empowers-maintainability)

Complex tools can quickly become a burden. We believe in the power of simplicity to make your code easier to understand, debug, and adapt over time. This library avoids unnecessary complexity, focusing on features that offer real value without sacrificing performance.

### Key Features

[](#key-features)

- **Fast**: Optimized for performance in production environments.
- **Framework Agnostic**: Integrates seamlessly with any project using the PSR-11 container interface.
- **Explicit Over Implicit**: Prioritizes explicit, readable configuration over hidden "magic", making your code easier to maintain.
- **Lightweight**: A minimal footprint keeps your project lean and efficient.
- **Compilation Support**: Optimizes performance further with built-in compilation, including anonymous functions.
- **Autowiring**: Simplify your code with automatic dependency resolution, available even after compilation.
- **Zero-Config Option**: Get started quickly with sensible defaults, no configuration required.
- **Circular Dependency Guard**: Automatically detects and helps you resolve circular dependencies.

### What's Not Included (and Why)

[](#whats-not-included-and-why)

This library intentionally omits certain features to prioritize simplicity, maintainability, and performance:

- **No Property Injection**: We encourage using constructor or method injection for greater clarity and testability. If dynamic configuration is needed, consider using anonymous functions within the container definition.
- **No Proxies/Lazy Loading**: These mechanisms often mask underlying design issues. Instead, focus on optimizing your code's structure and dependencies for better performance.
- **No "Prototype" Scope**: This library acts as a service container, ensuring consistent object instances. If you need a factory pattern, create a factory and register it in the container.
- **No Wildcard Definitions**: Wildcard definitions introduce implicit behavior that can become difficult to manage as your project grows. We prioritize explicit, readable configurations.
- **No Directory Loading**: Similar to wildcard definitions, directory loading can lead to implicit behavior and potential conflicts.
- **No `#[Service]` Attributes**: Explicitly defining services in your configuration makes them easier to locate, understand, and manage. This approach also improves performance as there's no need to scan directories for service attributes.
- **No Expression Language**: Closures provide enough flexibility for most use cases without introducing unnecessary complexity.
- **No Tagging**: Tagging can obscure dependencies. Instead, focus on defining explicit relationships between services.

These choices are made in order to keep the library lean, focused, and easy to understand. By avoiding features that could introduce unnecessary complexity or ambiguity, we aim to empower you to write cleaner, more maintainable code.

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

[](#installation)

```
composer require norvica/container
```

Read the [documentation](https://container.norvica.dev).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

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

Every ~2 days

Total

9

Last Release

716d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65d17adaa691f6946a6301320413a5871cd9a3284d49914f185b1bb7c7755eee?d=identicon)[serge-kvashnin](/maintainers/serge-kvashnin)

---

Top Contributors

[![serge-kvashnin](https://avatars.githubusercontent.com/u/75180587?v=4)](https://github.com/serge-kvashnin "serge-kvashnin (30 commits)")

---

Tags

containerdependency-injectionphpservice-containerstandalonephpcontainerdependencyinjectiondiservice

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[league/container

A fast and intuitive dependency injection container.

86387.8M343](/packages/league-container)[capsule/di

A PSR-11 compliant autowiring dependency injection container.

2857.5k2](/packages/capsule-di)

PHPackages © 2026

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