Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A generic function and convention to trigger deprecation notices

License

NotificationsYou must be signed in to change notification settings

symfony/deprecation-contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A generic function and convention to trigger deprecation notices.

This package provides a single global function namedtrigger_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 usingprintf() 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 emptyfunction trigger_deprecation() {} in your application.

About

A generic function and convention to trigger deprecation notices

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors10

Languages


[8]ページ先頭

©2009-2025 Movatter.jp