PHPackages                             symfony/deprecation-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. symfony/deprecation-contracts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

symfony/deprecation-contracts
=============================

A generic function and convention to trigger deprecation notices

v3.6.0(1y ago)2.1k825.6M—4.6%1020MITPHPPHP &gt;=8.1

Since Feb 14Pushed 1w ago3 watchersCompare

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

READMEChangelog (3)DependenciesVersions (37)Used By (20)

Symfony Deprecation Contracts
=============================

[](#symfony-deprecation-contracts)

A generic function and convention to trigger deprecation notices.

This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices.

By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments.

The function requires at least 3 arguments:

- the name of the Composer package that is triggering the deprecation
- the version of the package that introduced the deprecation
- the message of the deprecation
- more arguments can be provided: they will be inserted in the message using `printf()` formatting

Example:

```
trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
```

This will generate the following message: `Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`

While not recommended, the deprecation notices can be completely ignored by declaring an empty `function trigger_deprecation() {}` in your application.

###  Health Score

71

↑

ExcellentBetter than 100% of packages

Maintenance70

Regular maintenance activity

Popularity79

Solid adoption and visibility

Community42

Growing community involvement

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 56.1% 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 ~48 days

Recently: every ~0 days

Total

36

Last Release

601d ago

Major Versions

v2.5.0 → v3.0.02021-11-01

v2.5.2 → v3.0.12022-01-02

v2.5.3 → 3.2.x-dev2023-02-02

v2.5.4 → v3.4.32024-09-25

PHP version history (4 changes)v2.1.1PHP ^7.1

v2.1.2PHP &gt;=7.1

v3.0.0PHP &gt;=8.0.2

v3.1.1PHP &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 (37 commits)")[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (19 commits)")[![derrabus](https://avatars.githubusercontent.com/u/1506493?v=4)](https://github.com/derrabus "derrabus (2 commits)")[![GromNaN](https://avatars.githubusercontent.com/u/400034?v=4)](https://github.com/GromNaN "GromNaN (1 commits)")[![kbond](https://avatars.githubusercontent.com/u/127811?v=4)](https://github.com/kbond "kbond (1 commits)")[![lyrixx](https://avatars.githubusercontent.com/u/408368?v=4)](https://github.com/lyrixx "lyrixx (1 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (1 commits)")[![alexandre-daubois](https://avatars.githubusercontent.com/u/2144837?v=4)](https://github.com/alexandre-daubois "alexandre-daubois (1 commits)")[![xepozz](https://avatars.githubusercontent.com/u/6815714?v=4)](https://github.com/xepozz "xepozz (1 commits)")[![cedric-anne](https://avatars.githubusercontent.com/u/33253653?v=4)](https://github.com/cedric-anne "cedric-anne (1 commits)")[![chalasr](https://avatars.githubusercontent.com/u/7502063?v=4)](https://github.com/chalasr "chalasr (1 commits)")

---

Tags

contractsphpsymfonysymfony-contracts

### Embed Badge

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

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

PHPackages © 2026

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