PHPackages                             micoli/symfony-cartography - 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. [Framework](/categories/framework)
4. /
5. micoli/symfony-cartography

ActiveLibrary[Framework](/categories/framework)

micoli/symfony-cartography
==========================

Symfony cartography bundle

v1.0.0(9y ago)48MITPHPPHP &gt;=5.5.9

Since Feb 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/micoli/symfony-cartography)[ Packagist](https://packagist.org/packages/micoli/symfony-cartography)[ RSS](/packages/micoli-symfony-cartography/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (20)Versions (10)Used By (0)

Symfony Cartography bundle
==========================

[](#symfony-cartography-bundle)

[![tests](https://github.com/micoli/symfony-cartography/actions/workflows/lint.yaml/badge.svg)](https://github.com/micoli/symfony-cartography/actions/workflows/lint.yaml/badge.svg)[![lint](https://github.com/micoli/symfony-cartography/actions/workflows/tests.yaml/badge.svg)](https://github.com/micoli/symfony-cartography/actions/workflows/tests.yaml/badge.svg)

The aim of this bundle is to:

- provide an analysis of your project code bases (classes, class categorization, method calls to other service/class)
- draw a map of all possible method calls from and to a specific class::method. be ware that this map is calculated through static analysis, it's not the classes:methods called during a specific execution, it's all the possible calls from and to a class:method

[![toolbar](docs/simple-map.png)](docs/simple-map.png)

Requirements
------------

[](#requirements)

- PHP 8.1.0 or higher;
- PDO-SQLite PHP extension enabled for development;

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

[](#installation)

```
composer require --dev micoli/symfony-cartography
```

-
- add the line in `config\bundles.php`

```
Micoli\SymfonyCartography\SymfonyCartographyBundle::class => ['dev' => true, 'test' => true],`

```

- add a route in `config/routes.yaml`

```
when@dev:
    _symfony_cartography:
        resource: '@SymfonyCartographyBundle/Resources/config/routes.yaml'
        prefix: /_cartography

```

- and create `config/packages/symfony_cartography.yaml`

```
symfony_cartography:
  enabled: true
  sources:
    - '%kernel.project_dir%/src'
  filters:
    classes:
      rules:
        - '+App\' # all classes in namespace 'App\' will be excluding
        - '-App\Domain\DataFixtures' # except those starting by 'App\Domain\DataFixtures'
    method_calls:
      exclude_loopback: true #display sameClasse to sameClasse arrows
      rules:
      - '-Twig\' # do not display call towards classes in 'twig' namespace
      - '-ReflectionFunctionAbstract'
      - '-Doctrine\'
      - '-Symfony\'
      - '-Webmozart\'
      - '-Psr\'
  messenger_dispatchers: # Class/Method used to wire event trough messenger buses
    - class: App\Infrastructure\Bus\MessengerCommandBus
      method: dispatch
    - class: App\Infrastructure\Bus\MessengerEventDispatcher
      method: dispatch
  graph:
    engine: visjs # visjs|plantuml|cytoscape
    engine_uri: https://kroki.io/plantuml/svg
#    engine_uri: http://127.0.0.1:8080/svg # if local plantuml server
    withMethodDisplay: false # display methods in classes
    withMethodArrows: false # if disabled, only one arrow from a class to another is draw
    leftToRightDirection: false # if disabled graph is drawn top to bottom, else it is draw left To Right
  colors: # colors used in graph
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::undefined
        color: '#033270'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::doctrineEntity
        color: '#1368aa'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::controller
        color: '#4091c9'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::messengerCommandHandler
        color: '#9dcee2'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::messengerEventListener
        color: '#fedfd4'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::messengerEvent
        color: '#f29479'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::messengerCommand
        color: '#f26a4f'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::symfonyConsoleCommand
        color: '#ef3c2d'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::symfonyEventListener
        color: '#cb1b16'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::doctrineRepository
        color: '#65010c'
      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::symfonyEvent
        color: '#f29479'

```

Usage
-----

[](#usage)

- in `webProfiler` toolbar you can see a preview of the call graph from the current controller [![toolbar](docs/toolbar.png)](docs/toolbar.png)
- in `webProfiler` page a new section called `cartography` is present [![toolbar](docs/profiler.png)](docs/profiler.png)
- To clear inner psalm cache and refresh analysedCodebase `bin/console code:cartography --force`

```
Analysing
enrichedClasses: 56
methods: 25
method calls: 73
interfaceImplements: 34
classInterfaces: 35
Analyse done

```

- To use a local instance of plantuml `docker run -d -p 8080:8080 plantuml/plantuml-server:jetty`and in `config/packages/symfony_cartography.yaml`set

    ```
    symfony_cartography:
      graph:
        engine: plantuml
        engine_uri: http://127.0.0.1:8080/svg

    ```
- else to use a public instance of kroki

    ```
    symfony_cartography:
      graph:
        engine: plantuml
        engine_uri: https://kroki.io/plantuml/svg

    ```
- Tests

---

Execute this command to run tests:

```
$ make tests-all
```

Todo
====

[](#todo)

---

- manage symfony events and handler
- manage symfony services
- indirect from interfaces or use service definitions
- get called tree and calling tree

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 71.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 ~465 days

Recently: every ~20 days

Total

6

Last Release

1051d ago

PHP version history (3 changes)v1.0.0PHP &gt;=5.5.9

v0.5.0PHP &gt;=8.1

v0.7.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/f409a2fb140287a7bda88c5ac3828326e3ec4a11a2a2e2fa754a7b321e20a718?d=identicon)[micoli](/maintainers/micoli)

---

Top Contributors

[![javiereguiluz](https://avatars.githubusercontent.com/u/73419?v=4)](https://github.com/javiereguiluz "javiereguiluz (1267 commits)")[![bocharsky-bw](https://avatars.githubusercontent.com/u/3317635?v=4)](https://github.com/bocharsky-bw "bocharsky-bw (132 commits)")[![yceruto](https://avatars.githubusercontent.com/u/2028198?v=4)](https://github.com/yceruto "yceruto (84 commits)")[![voronkovich](https://avatars.githubusercontent.com/u/2299535?v=4)](https://github.com/voronkovich "voronkovich (54 commits)")[![micoli](https://avatars.githubusercontent.com/u/1434700?v=4)](https://github.com/micoli "micoli (27 commits)")[![rosier](https://avatars.githubusercontent.com/u/117380?v=4)](https://github.com/rosier "rosier (27 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (21 commits)")[![dmaicher](https://avatars.githubusercontent.com/u/921145?v=4)](https://github.com/dmaicher "dmaicher (16 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (14 commits)")[![davialexandre](https://avatars.githubusercontent.com/u/388373?v=4)](https://github.com/davialexandre "davialexandre (11 commits)")[![Coderberg](https://avatars.githubusercontent.com/u/36998159?v=4)](https://github.com/Coderberg "Coderberg (11 commits)")[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (10 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (10 commits)")[![ogizanagi](https://avatars.githubusercontent.com/u/2211145?v=4)](https://github.com/ogizanagi "ogizanagi (9 commits)")[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (9 commits)")[![94noni](https://avatars.githubusercontent.com/u/1358361?v=4)](https://github.com/94noni "94noni (7 commits)")[![wouterj](https://avatars.githubusercontent.com/u/749025?v=4)](https://github.com/wouterj "wouterj (7 commits)")[![derrabus](https://avatars.githubusercontent.com/u/1506493?v=4)](https://github.com/derrabus "derrabus (7 commits)")[![mstrom](https://avatars.githubusercontent.com/u/18350376?v=4)](https://github.com/mstrom "mstrom (6 commits)")[![Grafikart](https://avatars.githubusercontent.com/u/395137?v=4)](https://github.com/Grafikart "Grafikart (6 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/micoli-symfony-cartography/health.svg)

```
[![Health](https://phpackages.com/badges/micoli-symfony-cartography/health.svg)](https://phpackages.com/packages/micoli-symfony-cartography)
```

###  Alternatives

[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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