sensiolabs-de/deprecation-detector
最新稳定版本:0.1.0-alpha4
Composer 安装命令:
composer require sensiolabs-de/deprecation-detector
包简介
Command line tool to detect usage of deprecated code
README 文档
README
CAUTION: This package is abandoned and will no longer receive any updates.
The SensioLabs DeprecationDetector runs a static code analysis against your project's source code to find usages of deprecated methods, classes and interfaces. For Symfony projects, it also detects usages of deprecated services. It identifies the use of deprecated code thanks to the @deprecated annotation.
Disclaimer
Please note this tool is in a very early stage of development. Expect bugs and quirks.
Basic knowledge
The Sensiolabs DeprecationDetector is a command line command based on the Symfony Console component. It makes heavy use of the PHP-Parser library for analyzing PHP code.
The command works in three steps:
- Scanning your vendor libraries for defined deprecations and cache them as a
ruleset - Finding usages of those deprecations from your ruleset.
- Output with the affected code parts.
Installation
Composer
For a system-wide installation via Composer, you can run:
$ composer global require sensiolabs-de/deprecation-detector
Make sure you have ~/.composer/vendor/bin/ in your PATH and you will be able to call the deprecation-detector command.
PHAR
You can download the PHAR file available on the releases page:
curl -OL https://github.com/sensiolabs-de/deprecation-detector/releases/download/0.1.0-alpha4/deprecation-detector.phar php deprecation-detector.phar Standalone
Clone the repository
$ git clone git@github.com:sensiolabs-de/deprecation-detector.git
Run composer
$ composer install
Create phar archive with Box (optional)
$ box build
Provided you created the phar archive, if you want to call the deprecation-detector globally, it needs to be placed in your PATH. For example with:
$ chmod a+x deprecation-detector.phar $ mv deprecation-detector.phar /usr/local/bin/deprecation-detector
Otherwise you can call bin/deprecation-detector directly.
Usage
To use the DeprecationDetector you need to provide the source and the ruleset arguments
$ deprecation-detector check src/ vendor/ $ deprecation-detector check src/ composer.lock $ deprecation-detector check src/ .rules/some_generated_rule_set
Output
There are different output formats available, by default the output is printed in the commandline.
Html
$ deprecation-detector check src/ vendor/ --log-html deprecationlog.html
You can get a list of all options and arguments by running
$ deprecation-detector check --help
The default output might not fit into the cli. If that is the case you can set the output to a list by setting --output=simple.
$ deprecation-detector check src/ vendor/ --output=simple
Excluding deprecated method calls
You can exclude deprecated method calls by using the filter-methods option. This option takes a comma separated list of method references to exclude.
$ deprecation-detector check --filter-methods=MyClass::method,Foo::bar src/ vendor/
This will exclude all deprecated calls to MyClass::method and Foo::bar.
Contribution
Currently, the SensioLabs DeprecationDetector is in a very early state. Pull requests are welcome!
Maintainers
The DeprecationDetector is a project developed by the team at SensioLabs Deutschland, maintained by @marvin_klemp.
sensiolabs-de/deprecation-detector 适用场景与选型建议
sensiolabs-de/deprecation-detector 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 558.78k 次下载、GitHub Stars 达 395, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 sensiolabs-de/deprecation-detector 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sensiolabs-de/deprecation-detector 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 558.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 396
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04