PHPackages                             hasnrizvee/dep-reaper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. hasnrizvee/dep-reaper

ActiveLibrary

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.

v1.0.0(1mo ago)00MITPHPPHP &gt;=8.1CI passing

Since Mar 22Pushed 1mo agoCompare

[ Source](https://github.com/rizvee/dep-reaper)[ Packagist](https://packagist.org/packages/hasnrizvee/dep-reaper)[ RSS](/packages/hasnrizvee-dep-reaper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Stop Bloating Your PHP Apps: Meet DepReaper
===========================================

[](#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?
--------------

[](#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
----------

[](#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
------------

[](#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
---------------------------------

[](#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
-------------

[](#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:

```
