Repolode
symfony

symfony/dependency-injection

A PHP component for standardizing and centralizing how objects are constructed and wired together in an application.

Stars
4,166
Forks
92
Open issues
0
Last commit
12 hours ago

What is it?

The DependencyInjection component is a PHP library from the Symfony project. It provides a central container that defines how objects are constructed and which dependencies they receive, so that object creation is handled in one place rather than scattered through application code.

Because construction logic is centralized, classes can declare what they need instead of creating their own dependencies. This makes code easier to test, swap implementations in, and reconfigure without editing the classes that use them. The package is MIT licensed and is published as a standalone Symfony component that can be used outside the full framework.

The README is brief and points to the official Symfony documentation for usage details and contribution guidelines. Issues and pull requests are handled in the main Symfony repository rather than this package.

Key features

  • 01Centralizes object construction and dependency wiring in one container.
  • 02Lets classes declare dependencies instead of instantiating them directly.
  • 03Distributed as a standalone PHP package usable outside the full Symfony framework.
  • 04Released under the MIT license.

Use cases

  • Structuring a PHP application so services are created and configured in one place.
  • Making PHP classes easier to unit test by injecting their dependencies.
  • Using Symfony's container in a PHP project that does not run the full framework.

Topics

FAQ

What is dependency-injection?
A PHP component for standardizing and centralizing how objects are constructed and wired together in an application. The DependencyInjection component is a PHP library from the Symfony project. It provides a central container that defines how objects are constructed and which dependencies they receive, so that object creation is handled in one place rather than scattered through application code.
Is dependency-injection free to use? What license does it have?
dependency-injection is open source under the MIT license. Check the license terms before using it in commercial products.
Is dependency-injection still maintained?
Actively maintained. The last commit to dependency-injection was on Nov 6, 2026.
What can I use dependency-injection for?
Structuring a PHP application so services are created and configured in one place. Making PHP classes easier to unit test by injecting their dependencies. Using Symfony's container in a PHP project that does not run the full framework.
Where can I get dependency-injection?
The source code and installation instructions are on GitHub: https://github.com/symfony/dependency-injection

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects