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.2k↓33.3%32MITPHPPHP ^7.2 || ^8.0

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 1mo ago

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 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity72

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

852d 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

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)[friendsoftypo3/content-blocks

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

96374.6k23](/packages/friendsoftypo3-content-blocks)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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