symfony/deprecation-contracts
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Symfony/Deprecation-Contracts is a valuable toolkit designed to trigger deprecation warnings in a consistent manner. The function provided by this package is a universal way to tackle the task of alerting users about deprecated features in your PHP applications. Thus, it serves as a bridge, ensuring both developers and users are aware of any functionality that is being phased out without disrupting the operational flow.
To implement the Symfony/Deprecation-Contracts function, you use trigger_deprecation()
, a global function that triggers silenced deprecation notices. This function allows for granular expressions of deprecation, specifying the Composer package linked to the deprecation, the version in which the deprecation was introduced, and the message explaining the deprecation. Additional arguments can be defined for further detail, allowing printf()
formatting in the message.
In an illustrative example:
trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
This code will generate a message indicating that usage of "bitcoin" has been deprecated in favor of "fabcoin" since version 8.9 of the symfony/blockchain package. To completely ignore deprecation notices (though not recommended), you can declare an empty function trigger_deprecation() {}
in your application.
As per the information on the GitHub page, there doesn't appear to be an official dedicated documentation page for the symfony/deprecation-contracts. Developers are likely guided by the README provided on the GitHub repository, which contains essential details for understanding and using the package. However, for other components of the Symfony ecosystem, comprehensive documentation can usually be found on the official Symfony website.