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

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

quietfrog/dependency-graph
==========================

Dependency graph for PHP

0.5.0(11y ago)0141MITPHPPHP &gt;=5.4.0CI failing

Since Jul 8Pushed 11y ago1 watchersCompare

[ Source](https://github.com/alanbem/dependency-graph)[ Packagist](https://packagist.org/packages/quietfrog/dependency-graph)[ Docs](https://github.com/alanbem/dependency-graph)[ RSS](/packages/quietfrog-dependency-graph/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Dependency Graph
================

[](#dependency-graph)

[![Build Status](https://camo.githubusercontent.com/8601366de4025711289a4c2c7b1bba1953aea57908f80d8ad75ed13f62f895df/68747470733a2f2f7472617669732d63692e6f72672f616c616e62656d2f646570656e64656e63792d67726170682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alanbem/dependency-graph)[![Coverage Status](https://camo.githubusercontent.com/eed142c55ad31d9ffa4db27b3d2e12116ebf74e86ea92166106f0e8a9b8b2310/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f616c616e62656d2f646570656e64656e63792d67726170682f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/alanbem/dependency-graph?branch=master)

This library is a fork of  with the following changes:

- Renamed `DependencyManager` class to `Graph`
- Renamed base namespace to `QuietFrog`
- Hid some classes (e.g. `Operation`) in order to make library more generic.
- Removed tags handling

Documentation
=============

[](#documentation)

This is a simple implementation of a dependency graph (directed acyclic graph). Define services and dependencies between them. The graph keeps track of all dependencies and gives you an order in which services can be executed. This is especially convenient if you are working with long-running tasks and you want to identify which services may be executed in parallel.

Example
-------

[](#example)

```
$service1 = new YourService1();
$service2 = new YourService2();
$service3 = new YourService3();
$service4 = new YourService4();

$graph = new Graph();
$graph->add($service1)->add($service2)->add($service3)->add($service4);

$graph->addDependency($service1, $service2);
$graph->addDependency($service1, $service3);
$graph->addDependency($service2, $service4);
$graph->addDependency($service3, $service4);
```

This definition results in the following graph:

```
      1
    /  \
   2    3
    \  /
     4

```

Ask the graph which dependencies can be resolved. When service has been executed, mark it as resolved and ask for new available services.

```
$services = $graph->getUnresolvedDependencies(); // $service1
  $service1->doSomething();
$graph->markAsResolved($service1);
$services = $graph->getUnresolvedDependencies(); // $service2 and $service3
  $service3->doSomething();
$graph->markAsResolved($service3);
$services = $graph->getUnresolvedDependencies(); // $service2
  $service2->doSomething();
$graph->markAsResolved($service2);
$services = $graph->getUnresolvedDependencies(); // $service4
  $service4->doSomething();
```

More complex graphs are possible.

```
  1     2
  |    / \
  3   4   5
   \ /    |
    6     7
    |
    8

```

Acyclicity
----------

[](#acyclicity)

The graph is acyclic, which means something like this is NOT allowed:

```
$service1 = new YourService2();
$service2 = new YourService2();
$service3 = new YourService3();

$graph = new Graph();
$graph->add($service1)->add($service2)->add($service3);

$graph->addDependency($service1, $service2);
$graph->addDependency($service2, $service3);
$graph->addDependency($service3, $service1);
```

```
   1
  / \
 2 – 3

```

Cycles will be detected when the graph is initialized. A CircularDependencyDetectedException will be thrown.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~11 days

Total

5

Last Release

4285d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b2f437df78d876bb4289c60fce0d0e8cb705308e2b51ad0ced1ab3f13e73d8e?d=identicon)[alanbem](/maintainers/alanbem)

---

Top Contributors

[![alanbem](https://avatars.githubusercontent.com/u/320410?v=4)](https://github.com/alanbem "alanbem (12 commits)")[![MikeRoetgers](https://avatars.githubusercontent.com/u/217206?v=4)](https://github.com/MikeRoetgers "MikeRoetgers (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cloudstek/php-laff

Largest Area Fit First (LAFF) 3D box packing algorithm class for PHP

8774.9k](/packages/cloudstek-php-laff)[kpolicar/nova-date-range

Custom date range picker field for Laravel Nova

26176.8k2](/packages/kpolicar-nova-date-range)[tanmuhittin/nova-collapsible-groups

Makes nova core theme navigation collapsible

23179.0k](/packages/tanmuhittin-nova-collapsible-groups)

PHPackages © 2026

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