PHPackages                             ixnode/php-branch-diagram-builder - 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. ixnode/php-branch-diagram-builder

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

ixnode/php-branch-diagram-builder
=================================

PHP Branch Diagram Builder

v1.2.2(2y ago)13.3k[1 issues](https://github.com/ixnode/php-branch-diagram-builder/issues)1MITPHPPHP ^8.0

Since Jun 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ixnode/php-branch-diagram-builder)[ Packagist](https://packagist.org/packages/ixnode/php-branch-diagram-builder)[ Fund](https://ko-fi.com/bjoernhempel)[ RSS](/packages/ixnode-php-branch-diagram-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (10)Used By (1)

PHPBranchDiagramBuilder
=======================

[](#phpbranchdiagrambuilder)

[![PHP](https://camo.githubusercontent.com/a9281356639758f10e621e9f3ffe401e380630f265297afbe1da547e9c49a7a9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545372e34253230253743253743253230253545382e302d3737376262332e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d353535353535267374796c653d666c6174)](https://www.php.net/supported-versions.php)[![Latest Stable Version](https://camo.githubusercontent.com/b0a9a40de60393ef01c7d86e2c8d775b431e1cd5d5f02098c7fb95ea9a43826c/687474703a2f2f706f7365722e707567782e6f72672f69786e6f64652f7068702d6272616e63682d6469616772616d2d6275696c6465722f76)](https://packagist.org/packages/ixnode/php-branch-diagram-builder)[![Total Downloads](https://camo.githubusercontent.com/28bd03cd4adbbb653dbf53e3617190d245fa36554e18ead37b6b1acdce70c5d8/687474703a2f2f706f7365722e707567782e6f72672f69786e6f64652f7068702d6272616e63682d6469616772616d2d6275696c6465722f646f776e6c6f616473)](https://packagist.org/packages/ixnode/php-branch-diagram-builder)[![PHPStan](https://camo.githubusercontent.com/f3eb7f82e8aff9545215cf56332a4d7b84b6ef2287b84e61d02473f67e1f1aef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c6174)](https://phpstan.org/user-guide/rule-levels)[![PHPStan](https://camo.githubusercontent.com/ab66c01daa05a9d45a542da43bd296d4f26384943f0ad0fc4c3f6b9916a2b62b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485043532d50535231322d627269676874677265656e2e7376673f7374796c653d666c6174)](https://www.php-fig.org/psr/psr-12/)[![LICENSE](https://camo.githubusercontent.com/7f01c72c66194a1c08441472d646243f804d0e74e2bfab2d9f4a0b50ed8ab760/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d3432386637652e7376673f6c6f676f3d6f70656e253230736f75726365253230696e6974696174697665266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d353535353535267374796c653d666c6174)](https://github.com/ixnode/php-vault/blob/master/LICENSE)

A library with which branching strategies can be made visible as an image through a config file and included in documentation files such as README.md.

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

[](#installation)

```
$ composer require ixnode/php-branch-diagram-builder --dev
```

Usage
-----

[](#usage)

Create a file called `.pbdb.yml` with the following content:

```
title: Trunk Based Development
width: 1500
branches:
  - name: 'main'
    system: 'Productive system'
    color-light: '#0151ad'
    color-dark: '#024796'
  - name: 'development'
    system: 'Development system'
    color-light: '#01aaad'
    color-dark: '#029496'
  - name: ['feature', 1]
    system: 'Local development'
    color-light: '#70b964'
    color-dark: '#46733f'
  - name: ['feature', 2]
    system: 'Local development'
    color-light: '#f9a61b'
    color-dark: '#c48416'
  - name: ['feature', 3]
    system: 'Local development'
    color-light: '#ed1164'
    color-dark: '#b30c4c'
steps:
  - type: 'init'
    source: null
    target: 'main'
  - type: 'checkout'
    source: 'main'
    target: 'development'
  - type: 'checkout'
    source: 'development'
    target: ['feature', 1]
  - type: 'commit'
    source: ['feature', 1]
  - type: 'checkout'
    source: 'development'
    target: ['feature', 2]
  - type: 'commit'
    source: ['feature', 2]
  - type: 'merge'
    source: ['feature', 1]
    target: 'development'
  - type: 'checkout'
    source: 'development'
    target: 'main'
  - type: 'merge'
    source: 'development'
    target: ['feature', 2]
  - type: 'commit'
    source: ['feature', 2]
  - type: 'merge'
    source: ['feature', 2]
    target: 'development'
  - type: 'merge'
    source: 'development'
    target: 'main'
  - type: 'checkout'
    source: 'development'
    target: ['feature', 3]
  - type: 'commit'
    source: ['feature', 3]
  - type: 'merge'
    source: ['feature', 3]
    target: 'development'
  - type: 'merge'
    source: 'development'
    target: 'main'
```

Execute the following command:

```
$ vendor/bin/pbdb-builder build .pbdb.yml
```

It creates the following image:

[![Branching Strategy](.pbdb.png)](.pbdb.png)

This can be easily added to you README.md file:

```
![Branching Strategy](.phdb.png)

```

Development
-----------

[](#development)

### Clone the app:

[](#clone-the-app)

```
❯ git clone git@github.com:ixnode/php-branch-diagram-builder.git && \
  cd php-branch-diagram-builder
```

### Composer install

[](#composer-install)

```
❯ php -v
PHP 8.0.11 (cli) (built: Sep 23 2021 22:03:11) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.11, Copyright (c), by Zend Technologies
❯ composer -V
Composer version 2.1.9 2021-10-05 09:47:38
❯ composer install
...
```

### Run tests

[](#run-tests)

```
❯ composer test
```

Result```
> phpunit tests --testdox
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

Branch (Ixnode\PHPBranchDiagramBuilder\Tests\Branch)
 ✔ Branch
 ✔ Branch name
 ✔ Branch title

Step (Ixnode\PHPBranchDiagramBuilder\Tests\Step)
 ✔ 1) Test StepTest class (unknown: NULL -> master).
 ✔ 2) Test StepTest class (init: master -> master).
 ✔ 3) Test StepTest class (init: NULL -> master).
 ✔ 4) Test StepTest class (checkout: NULL -> master).
 ✔ 5) Test StepTest class (checkout: master -> NULL).
 ✔ 6) Test StepTest class (checkout: master -> master).
 ✔ 7) Test StepTest class (checkout: master -> develop).
 ✔ 8) Test StepTest class (commit: NULL -> master).
 ✔ 9) Test StepTest class (commit: master -> NULL).
 ✔ 10) Test StepTest class (commit: master -> master).
 ✔ 11) Test StepTest class (commit: master -> develop).
 ✔ 12) Test StepTest class (merge: NULL -> master).
 ✔ 13) Test StepTest class (merge: develop -> NULL).
 ✔ 14) Test StepTest class (merge: develop -> develop).
 ✔ 15) Test StepTest class (merge: develop -> master).

Time: 00:00.015, Memory: 6.00 MB

OK (18 tests, 35 assertions)
> phpstan analyse --level 8 --memory-limit 256M src tests
 24/24 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 [OK] No errors

> vendor/bin/php-cs-fixer --dry-run --using-cache=no --rules=@PSR12 fix src
Loaded config default.

Checked all files in 0.262 seconds, 14.000 MB memory used
> vendor/bin/php-cs-fixer --dry-run --using-cache=no --rules=@PSR12 fix tests
Loaded config default.

Checked all files in 0.035 seconds, 12.000 MB memory used
```

### Check the current version of the app:

[](#check-the-current-version-of-the-app)

```
# Git version
❯ git describe
v1.0.1

# VERSION file version
❯ cat VERSION
1.0.1
```

### Change version

[](#change-version)

Increase the version number according to your needs: ``.``.``

NameDescriptionCommand ParameterMAJORis increased when API incompatible changes are released.`--major 1`MINORis increased when new functionality that is compatible with the previous API is released.`--minor 1`PATCHis increased when changes include API-compatible bug fixes only.`--patch 1`- @see:

### Increase the version

[](#increase-the-version)

```
# Show version
❯ cat VERSION
1.0.2

# Push changed VERSION file
❯ git add VERSION
❯ git commit -m "Add version $(cat VERSION)"
❯ git push
```

### Tag the app (git)

[](#tag-the-app-git)

```
# Tag and push new git tag
❯ git tag -a "v$(cat VERSION)" -m "version v$(cat VERSION)"
❯ git push origin "v$(cat VERSION)"
```

### packagist.org

[](#packagistorg)

If you have connected your repository to packagist.org, check the result:

-

A. Authors
----------

[](#a-authors)

- Björn Hempel  - *Initial work* -

B. License
----------

[](#b-license)

This tutorial is licensed under the MIT License - see the [LICENSE.md](/LICENSE.md) file for details

C. Closing words
----------------

[](#c-closing-words)

Have fun! :)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~125 days

Recently: every ~161 days

Total

7

Last Release

1030d ago

PHP version history (2 changes)v1.0.0PHP ^7.4 || ^8.0

v1.2.1PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![bjoern-hempel](https://avatars.githubusercontent.com/u/5531245?v=4)](https://github.com/bjoern-hempel "bjoern-hempel (16 commits)")

---

Tags

branchbranching strategybranching diagrambranch diagram

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ixnode-php-branch-diagram-builder/health.svg)

```
[![Health](https://phpackages.com/badges/ixnode-php-branch-diagram-builder/health.svg)](https://phpackages.com/packages/ixnode-php-branch-diagram-builder)
```

###  Alternatives

[pocketmine/bedrock-data

Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP

115418.0k5](/packages/pocketmine-bedrock-data)[nahid/qarray

QArray is a PHP abstraction for querying array

108403.2k2](/packages/nahid-qarray)[iben12/laravel-statable

Statable trait for Laravel Eloquent models

96299.8k1](/packages/iben12-laravel-statable)[flyntwp/acf-field-group-composer

52145.4k](/packages/flyntwp-acf-field-group-composer)[terminal42/contao-leads

Leads extension for Contao Open Source CMS; Store and manage form data with ease!

41167.9k10](/packages/terminal42-contao-leads)[danielme85/laravel-geoip2

Service provider and DB downloader for Maxminds PHP API GeoIP2.

15169.3k](/packages/danielme85-laravel-geoip2)

PHPackages © 2026

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