PHPackages                             symfony/contracts - 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. symfony/contracts

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

symfony/contracts
=================

A set of abstractions extracted out of the Symfony components

v3.7.0(1mo ago)3.9k65.5M↓39.7%1920MITPHPPHP &gt;=8.1

Since Oct 31Pushed 4d ago14 watchersCompare

[ Source](https://github.com/symfony/contracts)[ Packagist](https://packagist.org/packages/symfony/contracts)[ Docs](https://symfony.com)[ Fund](https://symfony.com/sponsor)[ GitHub Sponsors](https://github.com/fabpot)[ RSS](/packages/symfony-contracts/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (8)Versions (71)Used By (20)

Symfony Contracts
=================

[](#symfony-contracts)

A set of abstractions extracted out of the Symfony components.

Can be used to build on semantics that the Symfony components proved useful - and that already have battle tested implementations.

Design Principles
-----------------

[](#design-principles)

- contracts are split by domain, each into their own sub-namespaces;
- contracts are small and consistent sets of PHP interfaces, traits, normative docblocks and reference test suites when applicable;
- all contracts must have a proven implementation to enter this repository;
- they must be backward compatible with existing Symfony components.

Packages that implement specific contracts should list them in the "provide" section of their "composer.json" file, using the `symfony/*-implementation`convention (e.g. `"provide": { "symfony/cache-implementation": "1.0" }`).

FAQ
---

[](#faq)

### How to use this package?

[](#how-to-use-this-package)

The abstractions in this package are useful to achieve loose coupling and interoperability. By using the provided interfaces as type hints, you are able to reuse any implementations that match their contracts. It could be a Symfony component, or another one provided by the PHP community at large.

Depending on their semantics, some interfaces can be combined with autowiring to seamlessly inject a service in your classes.

Others might be useful as labeling interfaces, to hint about a specific behavior that could be enabled when using autoconfiguration or manual service tagging (or any other means provided by your framework.)

### How is this different from PHP-FIG's PSRs?

[](#how-is-this-different-from-php-figs-psrs)

When applicable, the provided contracts are built on top of PHP-FIG's PSRs. But the group has different goals and different processes. Here, we're focusing on providing abstractions that are useful on their own while still compatible with implementations provided by Symfony. Although not the main target, we hope that the declared contracts will directly or indirectly contribute to the PHP-FIG.

Resources
---------

[](#resources)

- [Documentation](https://symfony.com/doc/current/components/contracts.html)
- [Contributing](https://symfony.com/doc/current/contributing/index.html)
- [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls)in the [main Symfony repository](https://github.com/symfony/symfony)

###  Health Score

79

—

ExcellentBetter than 100% of packages

Maintenance96

Actively maintained with recent releases

Popularity75

Solid adoption and visibility

Community46

Growing community involvement

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 64.3% 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 ~40 days

Recently: every ~97 days

Total

70

Last Release

16d ago

Major Versions

v1.10.0 → v3.2.02022-11-25

v2.5.3 → v3.4.22024-04-01

v2.5.4 → v3.4.32024-11-25

2.5.x-dev → 3.5.x-dev2024-12-07

v3.4.5 → 7.4.x-dev2025-05-01

PHP version history (7 changes)v1.0.0PHP ^7.1.3

v2.0.0PHP ^7.2.9

v2.0.1PHP ^7.2.5

v2.1.2PHP &gt;=7.2.5

v1.1.9PHP &gt;=7.1.3

v3.0.0PHP &gt;=8.0.2

v3.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47313?v=4)[Fabien Potencier](/maintainers/fabpot)[@fabpot](https://github.com/fabpot)

---

Top Contributors

[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (384 commits)")[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (71 commits)")[![derrabus](https://avatars.githubusercontent.com/u/1506493?v=4)](https://github.com/derrabus "derrabus (38 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (26 commits)")[![kbond](https://avatars.githubusercontent.com/u/127811?v=4)](https://github.com/kbond "kbond (10 commits)")[![alexandre-daubois](https://avatars.githubusercontent.com/u/2144837?v=4)](https://github.com/alexandre-daubois "alexandre-daubois (8 commits)")[![fancyweb](https://avatars.githubusercontent.com/u/3658119?v=4)](https://github.com/fancyweb "fancyweb (8 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (5 commits)")[![chalasr](https://avatars.githubusercontent.com/u/7502063?v=4)](https://github.com/chalasr "chalasr (4 commits)")[![lyrixx](https://avatars.githubusercontent.com/u/408368?v=4)](https://github.com/lyrixx "lyrixx (4 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (4 commits)")[![keradus](https://avatars.githubusercontent.com/u/2716794?v=4)](https://github.com/keradus "keradus (4 commits)")[![wouterj](https://avatars.githubusercontent.com/u/749025?v=4)](https://github.com/wouterj "wouterj (3 commits)")[![a-menshchikov](https://avatars.githubusercontent.com/u/2580489?v=4)](https://github.com/a-menshchikov "a-menshchikov (2 commits)")[![HypeMC](https://avatars.githubusercontent.com/u/2445045?v=4)](https://github.com/HypeMC "HypeMC (2 commits)")[![jack-worman](https://avatars.githubusercontent.com/u/66142217?v=4)](https://github.com/jack-worman "jack-worman (2 commits)")[![Kocal](https://avatars.githubusercontent.com/u/2103975?v=4)](https://github.com/Kocal "Kocal (2 commits)")[![KurtThiemann](https://avatars.githubusercontent.com/u/26512466?v=4)](https://github.com/KurtThiemann "KurtThiemann (2 commits)")[![andersonamuller](https://avatars.githubusercontent.com/u/1681800?v=4)](https://github.com/andersonamuller "andersonamuller (2 commits)")[![PhilETaylor](https://avatars.githubusercontent.com/u/400092?v=4)](https://github.com/PhilETaylor "PhilETaylor (2 commits)")

---

Tags

abstractionscomponentcontractsdecouplingdevinterfacesinteroperabilityphpstandardssymfonysymfony-componentstandardsinterfacesinteroperabilitycontractsabstractionsdecouplingdev

### Embed Badge

![Health badge](/badges/symfony-contracts/health.svg)

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[symfony/cache-contracts

Generic abstractions related to caching

2.4k324.3M286](/packages/symfony-cache-contracts)[symfony/translation-contracts

Generic abstractions related to translation

2.6k730.8M596](/packages/symfony-translation-contracts)[symfony/http-client-contracts

Generic abstractions related to HTTP clients

2.0k419.3M382](/packages/symfony-http-client-contracts)

PHPackages © 2026

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