ruudk/deprecation-contracts-with-backtrace
最新稳定版本:v3.6.0
Composer 安装命令:
composer require ruudk/deprecation-contracts-with-backtrace
包简介
A generic function and convention to trigger deprecation notices
README 文档
README
A drop-in replacement for symfony/deprecation-contracts that includes a backtrace in deprecation messages.
The Problem
When Symfony or other packages trigger deprecation warnings, you often see messages like:
Since symfony/framework-bundle 6.4: The "foo" option is deprecated.
But where is this deprecation triggered from? Without a backtrace, you have to search your entire codebase to find the source.
The Solution
This package adds a backtrace to every deprecation message, so you'll see:
Since symfony/framework-bundle 6.4: The "foo" option is deprecated.
/var/www/app/src/Controller/MyController.php:42
/var/www/app/src/Service/MyService.php:87
/var/www/app/vendor/symfony/framework-bundle/Controller/AbstractController.php:123
...
Now you can immediately see where the deprecation is being triggered.
Installation
composer require ruudk/deprecation-contracts-with-backtrace
That's it! The package uses Composer's replace directive to automatically replace symfony/deprecation-contracts. No configuration needed.
How it Works
This package provides the same trigger_deprecation() function as Symfony's deprecation-contracts, but appends a backtrace (up to 10 frames) to the deprecation message. Since it declares "replace": {"symfony/deprecation-contracts": "self.version"} in its composer.json, Composer will use this package instead of the original.
License
MIT License - see the LICENSE file for details.
Based on symfony/deprecation-contracts by Fabien Potencier and the Symfony Community.
统计信息
- 总下载量: 5.64k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-18