PHPackages                             nusje2000/dependency-graph - 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. nusje2000/dependency-graph

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

nusje2000/dependency-graph
==========================

A PHP Library for resolving, visualizing and validating composer dependencies within a repository. Works within a monolithic repository as well.

v2.6.0(2y ago)029.3k↓86.7%32MITPHPPHP ^7.2 || ^8.0CI failing

Since Dec 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nusje2000/dependency-graph)[ Packagist](https://packagist.org/packages/nusje2000/dependency-graph)[ RSS](/packages/nusje2000-dependency-graph/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (6)Versions (28)Used By (2)

Dependency graph
================

[](#dependency-graph)

[![Build](https://github.com/nusje2000/dependency-graph/actions/workflows/build.yml/badge.svg)](https://github.com/nusje2000/dependency-graph/actions/workflows/build.yml)

This package can be used to create a list of used packages and their dependencies.

### Installation

[](#installation)

Using composer:

```
composer require nusje2000/dependency-graph --dev

```

### Usage

[](#usage)

```
use Nusje2000\DependencyGraph\Cache\FileCache;
use Nusje2000\DependencyGraph\DependencyGraph;

// By default the DependencyGraph won't cache the result
$graph = DependencyGraph::build('/path/to/project/root');

// Using the FileCache to cache the dependency graph
$graph = DependencyGraph::build('/path/to/project/root', null, new FileCache());
```

The build method uses 3 parameters:

1. The root path, this is the path to the root of your project.
2. The builder, this class is used to build the dependency graph (leave null for default implementation).
3. The cache class, this class will be used to cache the result or to load the graph from if a cache exists.

### Visualizing dependencies

[](#visualizing-dependencies)

You can visualize the dependency graph by using `vendor/bin/dependency-graph search`. This console command can be used to search through the graph and look at information about certain packages. This command is still being worked on.

There is also a command for only visualizing a package (without the search dialog). i.e. you can use `vendor/bin/dependency-graph info nusje2000/dependency-graph`to see the dependencies of this package.

### Validating the dependency graph in monolithic repositories

[](#validating-the-dependency-graph-in-monolithic-repositories)

This package can be used to fetch all the packages defined in monolithic repositories. This has been implemented into a command in the `nusje2000/composer-monolith` package, which can be used to validate internal and external dependencies in a monolithic repository.

### Accessing the dependency graph

[](#accessing-the-dependency-graph)

```
use Nusje2000\DependencyGraph\DependencyGraph;

// building the dependency graph
$graph = DependencyGraph::build('/path/to/project/root');

// get the root path
$graph->getRootPath();

// get all packages
$packages = $graph->getPackages();

// checking if a package exists
$graph->hasPackage('foo/foo-pacakge');

// getting a specific package
$fooPackage = $graph->getPackage('foo/foo-pacakge');
$fooPackage->getName(); // return the name of the package (foo/foo-pacakge)
$fooPackage->getDependencies(); // returns a list of dependencies
$fooPackage->getPackageLocation(); // returns the location of the package
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 97.4% 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.

###  Release Activity

Cadence

Every ~67 days

Recently: every ~298 days

Total

23

Last Release

897d ago

Major Versions

v0.5.0 → v1.0.02020-01-04

v1.0.2 → v2.0.02020-01-05

PHP version history (3 changes)v0.1PHP &gt;=7.2 &lt;7.4

v0.4.1PHP ~7.2

v2.4.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17175959?v=4)[Maarten Nusteling](/maintainers/nusje2000)[@nusje2000](https://github.com/nusje2000)

---

Top Contributors

[![nusje2000](https://avatars.githubusercontent.com/u/17175959?v=4)](https://github.com/nusje2000 "nusje2000 (75 commits)")[![LucasdeRijke](https://avatars.githubusercontent.com/u/107672588?v=4)](https://github.com/LucasdeRijke "LucasdeRijke (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nusje2000-dependency-graph/health.svg)

```
[![Health](https://phpackages.com/badges/nusje2000-dependency-graph/health.svg)](https://phpackages.com/packages/nusje2000-dependency-graph)
```

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.1k](/packages/friendsofphp-php-cs-fixer)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[brianhenryie/strauss

Prefixes dependencies namespaces so they are unique to your plugin

190438.1k36](/packages/brianhenryie-strauss)[testo/testo

A lightweight PHP testing framework.

1959.3k53](/packages/testo-testo)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

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