PHPackages                             tomzx/php-dependency-extractor - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tomzx/php-dependency-extractor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tomzx/php-dependency-extractor
==============================

Scan directories to extract dependencies

38[1 issues](https://github.com/tomzx/php-dependency-extractor/issues)PHP

Since Sep 19Pushed 10y ago2 watchersCompare

[ Source](https://github.com/tomzx/php-dependency-extractor)[ Packagist](https://packagist.org/packages/tomzx/php-dependency-extractor)[ RSS](/packages/tomzx-php-dependency-extractor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#PHP Dependency Extractor

[![License](https://camo.githubusercontent.com/34a27ce9d5b249b8f7eef77417e4a8f83ac16cded652b5244ee56ed2cf6a18ca/68747470733a2f2f706f7365722e707567782e6f72672f746f6d7a782f7068702d646570656e64656e63792d657874726163746f722f6c6963656e73652e737667)](https://packagist.org/packages/tomzx/php-dependency-extractor)[![Latest Stable Version](https://camo.githubusercontent.com/215863fff2de61097613d28b9b5fc905ab3cabca57791f94a31f0f497d999866/68747470733a2f2f706f7365722e707567782e6f72672f746f6d7a782f7068702d646570656e64656e63792d657874726163746f722f762f737461626c652e737667)](https://packagist.org/packages/tomzx/php-dependency-extractor)[![Latest Unstable Version](https://camo.githubusercontent.com/f62ba8c50fd3dc967f984e8e75baa7d8302f8922c2671116da2052681036b59f/68747470733a2f2f706f7365722e707567782e6f72672f746f6d7a782f7068702d646570656e64656e63792d657874726163746f722f762f756e737461626c652e737667)](https://packagist.org/packages/tomzx/php-dependency-extractor)[![Build Status](https://camo.githubusercontent.com/33f46da7de9ad3c27daac08019d034bdc9bc7211be0ef9cf8947e8a768d94fe4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f746f6d7a782f7068702d646570656e64656e63792d657874726163746f722e737667)](https://travis-ci.org/tomzx/php-dependency-extractor)[![Code Quality](https://camo.githubusercontent.com/20ec4bc293cd134ab7473021acb01605f572d6eed3a83e24a4c2d78da60bf881/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f746f6d7a782f7068702d646570656e64656e63792d657874726163746f722e737667)](https://scrutinizer-ci.com/g/tomzx/php-dependency-extractor/code-structure)[![Code Coverage](https://camo.githubusercontent.com/5d227f65bcda02bd39ed0046df5676b3489d15d7fb5b55fc47fab6af644e9ffd/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f746f6d7a782f7068702d646570656e64656e63792d657874726163746f722e737667)](https://scrutinizer-ci.com/g/tomzx/php-dependency-extractor)[![Total Downloads](https://camo.githubusercontent.com/bc4b23e9cd7866668951d942d454d2be5ff54d34d76ab29aeaeb45a97d80beba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6d7a782f7068702d646570656e64656e63792d657874726163746f722e737667)](https://packagist.org/packages/tomzx/php-dependency-extractor)

`PHP Dependency Extractor` is a command line tool that will parse a directory of PHP source code to extract dependencies.

As it currently stands, `PHP Dependency Extractor` will extract the list of namespaces used. This can allow you, for instance, to figure out which libraries are used (or not).

Getting started
---------------

[](#getting-started)

1. Install `php-dependency-extractor` through composer, either globally or locally:

Locally

```
php composer require --dev tomzx/php-dependency-extractor
```

Globally

```
php composer global require tomzx/php-dependency-extractor
```

See the example section for examples of how to use the tool.

Example
-------

[](#example)

```
php bin/php-dependency-extractor extract --why target-path

File_Iterator_Facade
PHPDependencyExtractor\Console\Command\ExtractCommand
PHPDependencyExtractor\Extractor
PHPDependencyExtractor\Registry\Registry
PHPDependencyExtractor\Visitor\TrackedNameResolver
PhpParser\Lexer\Emulative
PhpParser\Node
PhpParser\NodeTraverser
PhpParser\NodeVisitor\NameResolver
PhpParser\Node\Stmt\UseUse
PhpParser\Parser
Symfony\Component\Console\Application
Symfony\Component\Console\Command\Command
Symfony\Component\Console\Helper\ProgressBar
Symfony\Component\Console\Input\InputArgument
Symfony\Component\Console\Input\InputInterface
Symfony\Component\Console\Input\InputOption
Symfony\Component\Console\Output\OutputInterface
```

License
-------

[](#license)

The code is licensed under the [MIT license](http://choosealicense.com/licenses/mit/). See [LICENSE](LICENSE).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/218f6db237e6937c05550d4d6df648f50cd9b26b098fc8c1be3930fe7d5c71e9?d=identicon)[tomzx](/maintainers/tomzx)

---

Top Contributors

[![tomzx](https://avatars.githubusercontent.com/u/188960?v=4)](https://github.com/tomzx "tomzx (13 commits)")

### Embed Badge

![Health badge](/badges/tomzx-php-dependency-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/tomzx-php-dependency-extractor/health.svg)](https://phpackages.com/packages/tomzx-php-dependency-extractor)
```

###  Alternatives

[paragonie/quill

Library for quickly and easily writing data to a Chronicle instance

2125.1k1](/packages/paragonie-quill)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
