承接 hasnrizvee/dep-reaper 相关项目开发

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

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

hasnrizvee/dep-reaper

最新稳定版本:v1.0.0

Composer 安装命令:

composer require hasnrizvee/dep-reaper

包简介

DepReaper: The ultimate PHP static analysis tool to find and remove unused Composer dependencies. Optimize your vendor directory with the Dependency Analyzer.

README 文档

README

Stop Bloating Your PHP Apps: Meet DepReaper

"Reap the dead weight from your PHP projects."

Dependency Bloat costs you money and time. It causes slower Docker builds, larger server images, and opens you up to security vulnerabilities in unused code.

DepReaper is the ultimate solution. It goes beyond binary used/unused status by providing deep recursive analysis, health scores, security surface reports, and GitHub Actions native outputs.

Why DepReaper?

Compared to traditional tools like composer-unused, DepReaper introduces several next-generation features:

  • The Analysis Engine: A high-performance symbol extractor that identifies classes, functions, and constants without executing the code.
  • XDebug Stealth Mode: Automatically detects and bypasses XDebug to prevent performance bottlenecks and segmentation faults during analysis.
  • Shadow Dependency Detection: Identifies packages that are required but never actually imported or utilized in the codebase.
  • Ghost Filters: Advanced exclusion rules (Named and Pattern-based) to ignore legitimate "invisible" dependencies like polyfills or dev-tooling.

Benchmarks

DepReaper is aggressively optimized for speed. By automatically utilizing XDebug Stealth Mode, it achieves a scanning speed up to 10x faster than running with XDebug overhead on typical manual audits.

Installation

Download the PHAR directly and run it anywhere:

curl -LO https://github.com/rizvee/dep-reaper/releases/latest/download/dep-reaper.phar
chmod +x dep-reaper.phar
mv dep-reaper.phar /usr/local/bin/dep-reaper

How to remove unused PHP packages

Run the analyzer from the root of your project:

dep-reaper --output=compact

Or run with auto-remove (dry run prompt included):

dep-reaper --fix

Configuration

Use a dep-reaper.php file in your project root to configure the DependencyAnalyzer. You can exclude specific folders or internal packages from the analysis:

<?php

use DepReaper\Engine\Configuration\Configuration;
use DepReaper\Engine\Filter\NamedFilter;
use DepReaper\Engine\Filter\PatternFilter;

return static function (Configuration $config): void {
    // Tell the analyzer to ignore a specific package
    $config->addNamedFilter(NamedFilter::fromString('symfony/dotenv'));
    // Tell the analyzer to ignore all packages by an org
    $config->addPatternFilter(PatternFilter::fromString('/symfony\/.*/'));
    // Exclude additional files
    $config->setAdditionalFilesFor('my/package', [__DIR__ . '/bootstrap/app.php']);
};

Speed up GitHub Actions by cleaning Composer dependencies

DepReaper runs natively in CI/CD pipelines, automatically detecting GITHUB_ACTIONS to output native error annotations (::error::).

      - run: dep-reaper --output=github

Credits

dep-reaper is created and maintained by Hasan Rizvee.

Inspired by the original composer-unused by Andreas Frömer and contributors. This project is an independent reimagination with a different scope, architecture, and feature set. Logo and brand by Hasan Rizvee.

Built on top of nikic/php-parser, Symfony Console, and composer-unused/symbol-parser.

License: MIT.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固