symfony/contracts

A set of abstractions extracted out of the Symfony components

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 16 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 17th, 2026
Created on July 13th, 2018
Open Issues & Pull Requests: 0 (+0)
GitHub issues: Disabled - open counts may still include pull requests.
Number of forks: 19
Total Stargazers: 3,930 (+0)
Total Subscribers: 14 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

GitHub issues are disabled for this repository, so issue analytics and the issue explorer are not available.

Detailed Description

Symfony Contracts is a collection of PHP interfaces and abstractions extracted from Symfony components that enable loose coupling and interoperability across packages.

The project addresses the need for standardized contracts that allow different implementations to work together seamlessly. Rather than coupling code directly to concrete implementations, developers can depend on the interfaces provided here. This approach lets packages declare which contracts they implement through Composer's "provide" mechanism, allowing consumers to swap implementations without changing their code. The contracts are organized by domain into separate namespaces and include PHP interfaces, traits, normative docblocks, and reference test suites where applicable.

Adoption makes sense if you are building libraries or applications that need to work with multiple implementations of the same functionality, or if you want to avoid tight coupling to specific Symfony components. The contracts are particularly useful with autowiring and service tagging in dependency injection containers. Unlike PHP-FIG's PSRs, which have broader standardization goals, these contracts are designed specifically to be compatible with Symfony implementations while remaining useful on their own. The project builds on top of PSRs where applicable but focuses on abstractions proven through actual use in Symfony components rather than theoretical standardization.

The project maintains a strict requirement that all contracts must have proven implementations before inclusion, ensuring practical utility. Development activity shows consistent engagement with issues and pull requests routed through the main Symfony repository rather than handled separately. The codebase emphasizes backward compatibility with existing Symfony components, meaning changes respect the stability guarantees that downstream packages depend on.