# symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

Repository: https://github.com/symfony/dependency-injection
Canonical: https://ross.abutalabs.com/products/dependency-injection
Homepage: https://symfony.com/dependency-injection
Language: PHP
License: MIT
License Family: permissive
Topics: php, symfony, component, symfony-component
Last push: 2026-08-22T13:46:38+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 5671, "days_push": 11, "days_rel": 11, "gap_med": 0, "n_releases_24m": 86}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4166, forks 93 (observed 2026-08-28T04:08:37.911884+00:00)

## What it is
The Symfony DependencyInjection component is a PHP library implementing a service container (dependency injection container) that standardizes and centralizes how objects are constructed and wired together in an application. It supports autowiring, configuration files, container compilation, and can be used standalone or as part of the Symfony framework.

## Use cases
- manage object construction and wiring in a PHP application
- set up a dependency injection container in PHP
- autowire services in a Symfony project
- decouple classes by injecting dependencies instead of creating them
- configure services with YAML/XML/PHP config files
- use a DI container in a standalone PHP app without the full framework

## When to choose
- you're building a Symfony application or using Symfony components
- you want a mature, battle-tested DI container with autowiring and compilation
- you need testable, decoupled service architecture in PHP
- you want a container usable outside any framework

## When to avoid
- you're working in a language other than PHP
- your project is small enough that manual construction is simpler
- you need a full application framework rather than just a container component

## Facets
- artifact type: library
- maturity: stable
- function: middleware, configuration-management, developer-tools
- domain: backend, web-development, developer-tools
- platform: php, cross-platform
- tags: dependency-injection, service-container, symfony-component, autowiring, ioc-container, php

## Member repositories
- symfony/dependency-injection (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:37.911884+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:46.508423+00:00, confidence not recorded.
  - readme: https://github.com/symfony/dependency-injection (fetched 2026-08-28T04:08:37.911884+00:00, sha 6d2f4ce7beb4)
  - homepage: https://symfony.com/dependency-injection (fetched 2026-08-29T09:13:31.614520+00:00, sha 3e325e87f78c)
  - site_page: https://symfony.com/doc (fetched 2026-08-29T09:13:31.617085+00:00, sha 44889134f4fb)
  - site_page: https://symfony.com/doc/current/components/dependency_injection.html (fetched 2026-08-29T09:13:31.619193+00:00, sha 41cc698f1a3f)
  - site_page: https://symfony.com/projects/phpmyfaq (fetched 2026-08-29T09:13:31.622643+00:00, sha b0b5a7438255)
  - site_page: https://symfony.com/releases (fetched 2026-08-29T09:13:31.624292+00:00, sha f109a7a4a5da)
  - site_page: https://symfony.com/blog/category/releases (fetched 2026-08-29T09:13:31.626238+00:00, sha da84802d18f3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
