Symfony Deprecation Contracts

repository·main·Indexed 24 days ago

https://github.com/symfony/deprecation-contracts

Provides a standardized, global trigger_deprecation() function for triggering silenced deprecation notices that can be caught and logged by error handlers.

Tokens
297
Snippets
2
Records
2
Agent score
35%

What's inside symfony-deprecation-contracts

  1. Trigger deprecation notices with trigger_deprecation()

    main

    The trigger_deprecation() function provides a standardized way to trigger silenced deprecation notices. It is designed to work with custom PHP error handlers (like the one in the Symfony ErrorHandler component) to catch and log deprecations in both development and production environments.

    To use the function, you must provide at least three arguments:

    1. Package Name: The name of the Composer package triggering the deprecation.
    2. Version: The version of the package that introduced the deprecation.
    3. Message: The deprecation message.

    You can provide additional arguments which will be injected into the message using printf() formatting.

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