PHPackages                             innmind/object-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. innmind/object-graph

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

innmind/object-graph
====================

Extract object graph out of a root object

3.4.0(2mo ago)242.8k↓75%26MITPHPPHP ~8.4CI passing

Since Nov 4Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Innmind/ObjectGraph)[ Packagist](https://packagist.org/packages/innmind/object-graph)[ Docs](http://github.com/Innmind/ObjectGraph)[ RSS](/packages/innmind-object-graph/feed)WikiDiscussions develop Synced 3d ago

READMEChangelog (4)Dependencies (5)Versions (22)Used By (6)

ObjectGraph
===========

[](#objectgraph)

[![Build Status](https://github.com/innmind/objectgraph/workflows/CI/badge.svg?branch=master)](https://github.com/innmind/objectgraph/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/b60e536d319218d681cf8fe6f865cbfb3109004aae18bb4e57e8db2366b8c9fd/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f6f626a65637467726170682f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/objectgraph)[![Type Coverage](https://camo.githubusercontent.com/30a839da01ea2dd504fac083e8fecf4b3ec7a5e04e4c5635beb906ad9b321c49/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f6f626a65637467726170682f636f7665726167652e737667)](https://shepherd.dev/github/innmind/objectgraph)

Small library to generate an abstract graph out of an object and its dependencies.

You can then visualize this graph by rendering it with graphviz.

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

[](#installation)

```
composer require innmind/object-graph
```

Usage
-----

[](#usage)

```
use Innmind\ObjectGraph\{
    Lookup,
    Render,
    RewriteLocation\SublimeHandler,
};
use Innmind\OperatingSystem\Factory;
use Innmind\Server\Control\Server\Command;

$lookup = Lookup::of();
$render = Render::of(
    new SublimeHandler, // optional, useful to open the file in Sublime Text instead of the browser
);

$objectGraph = $lookup($theRootObjectOfYourApp); // the object could be the framework instance for example

Factory::build()
    ->control()
    ->processes()
    ->execute(
        Command::foreground('dot')
            ->withShortOption('Tsvg')
            ->withShortOption('o', 'graph.svg')
            ->withInput($render($objectGraph)),
    )
    ->unwrap()
    ->wait();
```

This will generate a `graph.svg` file representing the object graph of your application.

Note

This example uses `innmind/operating-system` to generate the svg file but the package is not a direct dependency, you can use the content returned by `$render()` however you wish.

Note

You can pass an implementation of [`RewriteLocation`](src/RewriteLocation.php) as the first argument of `Render` so you can rewrite the url to the class file that will be used in the generated graph (useful if you want to generate urls to [open the files directly in your IDE](https://github.com/sanduhrs/phpstorm-url-handler#usage)).

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance90

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.2% 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 ~148 days

Recently: every ~260 days

Total

19

Last Release

75d ago

Major Versions

1.6.0 → 2.0.02020-01-08

2.1.0 → 3.0.02023-04-23

PHP version history (5 changes)1.0.0PHP ~7.2

2.0.0PHP ~7.4

2.1.0PHP ~7.4|~8.0

3.0.0PHP ~8.1

3.4.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (161 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")[![mablae](https://avatars.githubusercontent.com/u/389360?v=4)](https://github.com/mablae "mablae (1 commits)")

---

Tags

dotobject graphgraphviz

### Embed Badge

![Health badge](/badges/innmind-object-graph/health.svg)

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

###  Alternatives

[myclabs/deep-copy

Create deep copies (clones) of your objects

8.9k849.8M169](/packages/myclabs-deep-copy)[dflydev/dot-access-data

Given a deep data structure, access data by dot notation.

718359.1M86](/packages/dflydev-dot-access-data)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[graphp/graphviz

GraphViz graph drawing for the mathematical graph/network library GraPHP.

3232.1M49](/packages/graphp-graphviz)[alom/graphviz

Graphviz generation for PHP

74651.4k9](/packages/alom-graphviz)[flow-php/array-dot

PHP ETL - Array Dot functions

14374.1k3](/packages/flow-php-array-dot)

PHPackages © 2026

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