承接 symfony/deprecation-contracts 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

symfony/deprecation-contracts

最新稳定版本:v3.6.0

Composer 安装命令:

composer require symfony/deprecation-contracts

包简介

A generic function and convention to trigger deprecation notices

README 文档

README

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.

统计信息

  • 总下载量: 780.57M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2113
  • 点击次数: 1
  • 依赖项目数: 414
  • 推荐数: 0

GitHub 信息

  • Stars: 2108
  • Watchers: 3
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04