PHPackages                             depone/depone - 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. [CLI &amp; Console](/categories/cli)
4. /
5. depone/depone

ActiveLibrary[CLI &amp; Console](/categories/cli)

depone/depone
=============

A static analysis tool for PHP that helps you eliminate require\_once-related issues.

v0.2.1(3d ago)20[5 issues](https://github.com/lll-lll-lll-lll/depone/issues)[1 PRs](https://github.com/lll-lll-lll-lll/depone/pulls)MITPHPPHP ^8.1CI passing

Since Jul 4Pushed yesterdayCompare

[ Source](https://github.com/lll-lll-lll-lll/depone)[ Packagist](https://packagist.org/packages/depone/depone)[ Docs](https://github.com/lll-lll-lll-lll/depone)[ GitHub Sponsors](https://github.com/lll-lll-lll-lll)[ RSS](/packages/depone-depone/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (6)Versions (14)Used By (0)

depone
======

[](#depone)

[![CI](https://github.com/lll-lll-lll-lll/depone/actions/workflows/ci.yml/badge.svg)](https://github.com/lll-lll-lll-lll/depone/actions/workflows/ci.yml)[![Latest Version](https://camo.githubusercontent.com/0be5b9d7418582c1a770985637c50559820710a2754d0edef1bdd6527f2b536e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465706f6e652f6465706f6e65)](https://packagist.org/packages/depone/depone)[![PHP Version](https://camo.githubusercontent.com/d31c2d7649a59274fec14ebc3a893c8b295cde11d2ea50f93e8d0f3e2a059fc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6465706f6e652f6465706f6e652f706870)](https://packagist.org/packages/depone/depone)[![License](https://camo.githubusercontent.com/a8061c67bb3ee78454db68bea6e15202e932973bd4f98bae8d483da639c79c10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465706f6e652f6465706f6e653f63616368655365636f6e64733d33363030)](LICENSE)

> Delete legacy `require_once` with proof, not guesswork.

Legacy PHP codebases carry hundreds of `require_once` lines that Composer autoload made unnecessary years ago. Deleting them by hand is a gamble: some are dead weight, some are hiding a broken autoload rule, and some load a *different* copy of a class than the autoloader would.

`depone` reads every PHP file in your repository, statically resolves each `require_once` target, and tells those cases apart — in one command, with no configuration, and without ever rewriting your code:

- **redundant** — the target is already autoloaded; deleting the require is provably safe
- **fixable** — the target *should* be autoloaded but isn't (broken autoload config)
- **conflicting** — the require loads a shadowed copy; deleting it would change which class definition loads

[![depone finding redundant require_once statements](docs/demo.gif)](docs/demo.gif)

Installation
------------

[](#installation)

Requires PHP 8.1+ and Composer.

```
composer require --dev depone/depone
```

Quick start
-----------

[](#quick-start)

Run the analyzer from the root of a Composer project:

```
vendor/bin/depone
```

Take a typical legacy front controller, written before Composer autoload was introduced:

```
