# symfony/contracts

A set of abstractions extracted out of the Symfony components

Repository: https://github.com/symfony/contracts
Canonical: https://ross.abutalabs.com/products/contracts
Homepage: https://symfony.com/contracts
Language: PHP
License: MIT
License Family: permissive
Topics: php, symfony, abstractions, component, contracts, decoupling, interfaces, interoperability, standards, symfony-component, dev
Last push: 2026-08-04T09:44:57+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 90, longevity 100
- inputs: {"age_days": 2973, "days_push": 29, "days_rel": 67, "gap_med": 25.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3927, forks 19 (observed 2026-08-28T04:08:29.914583+00:00)

## What it is
Symfony Contracts is a set of PHP interfaces, traits, and normative docblocks extracted from Symfony components, published as small per-domain packages. It lets developers type-hint against stable abstractions so their code works with any conforming implementation, Symfony's or otherwise.

## Use cases
- decouple my PHP code from specific Symfony component implementations
- type-hint against interfaces so any compatible library can be swapped in
- build a PHP package that interoperates with Symfony components
- use autowiring-friendly interfaces for dependency injection
- declare which contracts my package implements via composer 'provide'
- find a PHP equivalent to PSRs with Symfony-backed semantics

## When to choose
- you write framework-agnostic PHP libraries that should work with Symfony
- you want loose coupling and swappable implementations behind stable interfaces
- you build services meant to be injected via Symfony autowiring
- you need battle-tested abstractions with reference test suites

## When to avoid
- you need concrete implementations rather than interfaces
- your project doesn't use Composer or PHP
- you only target PSR standards and don't need Symfony-specific semantics

## Facets
- artifact type: library
- maturity: stable
- function: middleware, plugin-system, developer-tools
- domain: web-development, backend, developer-tools, apis
- platform: php, cross-platform
- tags: interfaces, abstractions, decoupling, interoperability, standards, symfony, composer, loose-coupling, type-hints, service-container, php

## Member repositories
- symfony/contracts (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:29.914583+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:24:42.786688+00:00, confidence not recorded.
  - readme: https://github.com/symfony/contracts (fetched 2026-08-28T04:08:29.914583+00:00, sha 6565e981db9c)
  - homepage: https://symfony.com/contracts (fetched 2026-08-29T09:18:34.545982+00:00, sha 3a8784187ade)
  - site_page: https://symfony.com/doc (fetched 2026-08-29T09:18:34.555149+00:00, sha 44889134f4fb)
  - site_page: https://symfony.com/doc/current/components/contracts.html (fetched 2026-08-29T09:18:34.557212+00:00, sha de4a0a952650)
  - site_page: https://symfony.com/releases (fetched 2026-08-29T09:18:34.559002+00:00, sha f109a7a4a5da)
  - site_page: https://symfony.com/blog/category/releases (fetched 2026-08-29T09:18:34.560831+00:00, sha da84802d18f3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
