# php-fig/container

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/php-fig-container).**

10,012 stars · 53 forks · PHP · MIT

## Links

- GitHub: https://github.com/php-fig/container
- awesome-repositories: https://awesome-repositories.com/repository/php-fig-container.md

## Description

This project is a shared technical specification and standard interface for dependency injection containers in PHP. It defines a common set of interfaces for retrieving services and dependencies, ensuring that different container implementations remain interoperable across the PHP ecosystem.

By establishing a standardized API for dependency retrieval, the project allows developers to create libraries that function with any compliant container. This prevents vendor lock-in and enables different container implementations to be swapped without requiring changes to the application code.

The specification covers the standardization of container interfaces and the definition of a uniform method for service resolution. This provides a consistent foundation for building custom service containers and developing interoperable packages.

## Tags

### Software Engineering & Architecture

- [Dependency Injection Containers](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection-containers.md) — Defines the common interface specification for dependency injection containers to ensure ecosystem interoperability. ([source](https://github.com/php-fig/container#readme))
- [Dependency Injection](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection.md) — Standardizes the creation and management of objects across the PHP ecosystem via a common DI interface.
- [Dependency Injection](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/dependency-injection.md) — Establishes a standardized API for dependency injection to prevent vendor lock-in across different libraries.
- [Interoperability Specifications](https://awesome-repositories.com/f/software-engineering-architecture/interoperability-specifications.md) — Serves as a shared technical specification for interchangeable dependency injection containers.
- [Contract and Abstraction Patterns](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/abstraction-domain-modeling/contract-abstraction-patterns.md) — Provides an abstraction layer that decouples dependency retrieval logic from specific container implementations.
- [Interface Standardization](https://awesome-repositories.com/f/software-engineering-architecture/inversion-of-control-containers/interface-standardization.md) — Provides a common set of interfaces that allow different service containers to be swapped seamlessly.
- [Type-Safe Dependency Resolution](https://awesome-repositories.com/f/software-engineering-architecture/type-safe-dependency-resolution.md) — Uses PHP interface definitions to ensure type-safe resolution and consistent return types for services.

### Programming Languages & Runtimes

- [Interface Contract Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/interface-contract-implementations.md) — Defines a strict set of interface contracts that all compliant service containers must implement for consistency.
- [PHP Standard Interface Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/php-standard-interface-implementations.md) — Defines the standard PSR interface that custom service containers must implement for compatibility.

### Web Development

- [Container Interface Standards](https://awesome-repositories.com/f/web-development/web-standards/standards-compliant-implementations/container-interface-standards.md) — Implements the standard PSR interface for retrieving services and dependencies from a container.

### User Interface & Experience

- [Dependency Injection Interoperability](https://awesome-repositories.com/f/user-interface-experience/cross-platform-ui-frameworks/framework-interoperability/dependency-injection-interoperability.md) — Enables the creation of PHP libraries that work with any PSR-compliant container.
