1Symfony Deprecation Contracts
2=============================
3
4A generic function and convention to trigger deprecation notices.
5
6This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices.
7
8By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component,
9the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments.
10
11The function requires at least 3 arguments:
12 - the name of the Composer package that is triggering the deprecation
13 - the version of the package that introduced the deprecation
14 - the message of the deprecation
15 - more arguments can be provided: they will be inserted in the message using `printf()` formatting
16
17Example:
18```php
19trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
20```
21
22This will generate the following message:
23`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`
24
25While not recommended, the deprecation notices can be completely ignored by declaring an empty
26`function trigger_deprecation() {}` in your application.
27