# symfony/service-contracts

Generic abstractions related to writing services

Repository: https://github.com/symfony/service-contracts
Canonical: https://ross.abutalabs.com/products/service-contracts
Homepage: https://symfony.com
Language: PHP
License: MIT
License Family: permissive
Topics: php, symfony, abstractions, contracts, decoupling, interfaces, interoperability, standards, symfony-contracts
Last push: 2026-07-27T15:48:46+00:00

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

## Adoption (not part of the score)
Stars 2611, forks 7 (observed 2026-08-28T04:07:04.374161+00:00)

## What it is
A set of PHP interfaces and abstractions extracted from Symfony components, defining contracts for writing services that decouple code from specific implementations. It allows libraries to depend on stable, battle-tested semantics rather than concrete Symfony classes.

## Use cases
- decouple my PHP library from Symfony's concrete service implementations
- define standard interfaces for services so third-party packages can interoperate
- type-hint against abstractions instead of Symfony components in my code
- make my bundle compatible with multiple Symfony versions
- share common service semantics across PHP packages
- avoid hard dependencies on Symfony internals in reusable code

## When to choose
- you are building a PHP library or bundle that should integrate with Symfony without depending on its concrete classes
- you want interoperability with the broader Symfony ecosystem using standard contracts
- you need stable, battle-tested abstractions maintained by the Symfony project

## When to avoid
- you are building a standalone application with no need for framework decoupling
- your project does not use PHP or the Symfony ecosystem
- you need runtime behavior or implementations rather than pure interfaces

## Facets
- artifact type: library
- maturity: stable
- function: middleware, plugin-system, developer-tools
- domain: web-development, backend, developer-tools, apis
- platform: php, cross-platform
- tags: service-abstractions, interfaces, decoupling, interoperability, symfony-ecosystem, dependency-injection, contracts, php

## Member repositories
- symfony/service-contracts (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:04.374161+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-30T02:20:52.303847+00:00, confidence not recorded.
  - readme: https://github.com/symfony/service-contracts (fetched 2026-08-28T04:07:04.374161+00:00, sha cc42b3133878)
  - homepage: https://symfony.com (fetched 2026-08-29T10:03:37.393378+00:00, sha 68595089eb73)
  - site_page: https://symfony.com/doc/current/contributing/community/releases.html (fetched 2026-08-29T10:03:37.404361+00:00, sha e46dc2ffbd61)
  - site_page: https://symfony.com/releases (fetched 2026-08-29T10:03:37.406294+00:00, sha 2fd410222cfe)
  - site_page: https://symfony.com/doc (fetched 2026-08-29T10:03:37.402550+00:00, sha 44889134f4fb)
  - site_page: https://symfony.com/blog/category/releases (fetched 2026-08-29T10:03:37.408199+00:00, sha b626b5bb1423)
- Data as of 2026-08-30T08:39:29.467469+00:00.
