{"id":18610579,"url":"https://github.com/ixnode/php-branch-diagram-builder","last_synced_at":"2025-11-02T21:30:24.916Z","repository":{"id":45146934,"uuid":"365007354","full_name":"ixnode/php-branch-diagram-builder","owner":"ixnode","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-21T21:30:12.000Z","size":177,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T12:25:40.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ixnode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"bjoernhempel"}},"created_at":"2021-05-06T18:48:53.000Z","updated_at":"2022-12-18T00:09:34.000Z","dependencies_parsed_at":"2024-11-07T03:11:19.843Z","dependency_job_id":"1b0fb023-ff02-493f-b0a6-93c69047351c","html_url":"https://github.com/ixnode/php-branch-diagram-builder","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-branch-diagram-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-branch-diagram-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-branch-diagram-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-branch-diagram-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ixnode","download_url":"https://codeload.github.com/ixnode/php-branch-diagram-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239400606,"owners_count":19632051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T03:11:07.537Z","updated_at":"2025-11-02T21:30:24.874Z","avatar_url":"https://github.com/ixnode.png","language":"PHP","funding_links":["https://ko-fi.com/bjoernhempel"],"categories":[],"sub_categories":[],"readme":"# PHPBranchDiagramBuilder\n\n[![PHP](https://img.shields.io/badge/PHP-^7.4%20||%20^8.0-777bb3.svg?logo=php\u0026logoColor=white\u0026labelColor=555555\u0026style=flat)](https://www.php.net/supported-versions.php)\n[![Latest Stable Version](http://poser.pugx.org/ixnode/php-branch-diagram-builder/v)](https://packagist.org/packages/ixnode/php-branch-diagram-builder)\n[![Total Downloads](http://poser.pugx.org/ixnode/php-branch-diagram-builder/downloads)](https://packagist.org/packages/ixnode/php-branch-diagram-builder)\n[![PHPStan](https://img.shields.io/badge/PHPStan-Level%208-brightgreen.svg?style=flat)](https://phpstan.org/user-guide/rule-levels)\n[![PHPStan](https://img.shields.io/badge/PHPCS-PSR12-brightgreen.svg?style=flat)](https://www.php-fig.org/psr/psr-12/)\n[![LICENSE](https://img.shields.io/badge/License-MIT-428f7e.svg?logo=open%20source%20initiative\u0026logoColor=white\u0026labelColor=555555\u0026style=flat)](https://github.com/ixnode/php-vault/blob/master/LICENSE)\n\nA library with which branching strategies can be made visible as an image through a config file and included in\ndocumentation files such as README.md.\n\n## Installation\n\n```bash\n$ composer require ixnode/php-branch-diagram-builder --dev\n```\n\n## Usage\n\nCreate a file called `.pbdb.yml` with the following content:\n\n```yaml\ntitle: Trunk Based Development\nwidth: 1500\nbranches:\n  - name: 'main'\n    system: 'Productive system'\n    color-light: '#0151ad'\n    color-dark: '#024796'\n  - name: 'development'\n    system: 'Development system'\n    color-light: '#01aaad'\n    color-dark: '#029496'\n  - name: ['feature', 1]\n    system: 'Local development'\n    color-light: '#70b964'\n    color-dark: '#46733f'\n  - name: ['feature', 2]\n    system: 'Local development'\n    color-light: '#f9a61b'\n    color-dark: '#c48416'\n  - name: ['feature', 3]\n    system: 'Local development'\n    color-light: '#ed1164'\n    color-dark: '#b30c4c'\nsteps:\n  - type: 'init'\n    source: null\n    target: 'main'\n  - type: 'checkout'\n    source: 'main'\n    target: 'development'\n  - type: 'checkout'\n    source: 'development'\n    target: ['feature', 1]\n  - type: 'commit'\n    source: ['feature', 1]\n  - type: 'checkout'\n    source: 'development'\n    target: ['feature', 2]\n  - type: 'commit'\n    source: ['feature', 2]\n  - type: 'merge'\n    source: ['feature', 1]\n    target: 'development'\n  - type: 'checkout'\n    source: 'development'\n    target: 'main'\n  - type: 'merge'\n    source: 'development'\n    target: ['feature', 2]\n  - type: 'commit'\n    source: ['feature', 2]\n  - type: 'merge'\n    source: ['feature', 2]\n    target: 'development'\n  - type: 'merge'\n    source: 'development'\n    target: 'main'\n  - type: 'checkout'\n    source: 'development'\n    target: ['feature', 3]\n  - type: 'commit'\n    source: ['feature', 3]\n  - type: 'merge'\n    source: ['feature', 3]\n    target: 'development'\n  - type: 'merge'\n    source: 'development'\n    target: 'main'\n```\n\nExecute the following command:\n\n```bash\n$ vendor/bin/pbdb-builder build .pbdb.yml\n```\n\nIt creates the following image:\n\n![Branching Strategy](.pbdb.png)\n\nThis can be easily added to you README.md file:\n\n```text\n![Branching Strategy](.phdb.png)\n```\n\n## Development\n\n### Clone the app:\n\n```bash\n❯ git clone git@github.com:ixnode/php-branch-diagram-builder.git \u0026\u0026 \\\n  cd php-branch-diagram-builder\n```\n\n### Composer install\n\n```bash\n❯ php -v\nPHP 8.0.11 (cli) (built: Sep 23 2021 22:03:11) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v4.0.11, Copyright (c) Zend Technologies\n    with Zend OPcache v8.0.11, Copyright (c), by Zend Technologies\n❯ composer -V\nComposer version 2.1.9 2021-10-05 09:47:38\n❯ composer install\n...\n```\n\n### Run tests\n\n```bash\n❯ composer test\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eResult\u003c/summary\u003e\n\n```bash\n\u003e phpunit tests --testdox\nPHPUnit 9.5.10 by Sebastian Bergmann and contributors.\n\nBranch (Ixnode\\PHPBranchDiagramBuilder\\Tests\\Branch)\n ✔ Branch\n ✔ Branch name\n ✔ Branch title\n\nStep (Ixnode\\PHPBranchDiagramBuilder\\Tests\\Step)\n ✔ 1) Test StepTest class (unknown: NULL -\u003e master).\n ✔ 2) Test StepTest class (init: master -\u003e master).\n ✔ 3) Test StepTest class (init: NULL -\u003e master).\n ✔ 4) Test StepTest class (checkout: NULL -\u003e master).\n ✔ 5) Test StepTest class (checkout: master -\u003e NULL).\n ✔ 6) Test StepTest class (checkout: master -\u003e master).\n ✔ 7) Test StepTest class (checkout: master -\u003e develop).\n ✔ 8) Test StepTest class (commit: NULL -\u003e master).\n ✔ 9) Test StepTest class (commit: master -\u003e NULL).\n ✔ 10) Test StepTest class (commit: master -\u003e master).\n ✔ 11) Test StepTest class (commit: master -\u003e develop).\n ✔ 12) Test StepTest class (merge: NULL -\u003e master).\n ✔ 13) Test StepTest class (merge: develop -\u003e NULL).\n ✔ 14) Test StepTest class (merge: develop -\u003e develop).\n ✔ 15) Test StepTest class (merge: develop -\u003e master).\n\nTime: 00:00.015, Memory: 6.00 MB\n\nOK (18 tests, 35 assertions)\n\u003e phpstan analyse --level 8 --memory-limit 256M src tests\n 24/24 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%\n\n [OK] No errors\n\n\u003e vendor/bin/php-cs-fixer --dry-run --using-cache=no --rules=@PSR12 fix src\nLoaded config default.\n\nChecked all files in 0.262 seconds, 14.000 MB memory used\n\u003e vendor/bin/php-cs-fixer --dry-run --using-cache=no --rules=@PSR12 fix tests\nLoaded config default.\n\nChecked all files in 0.035 seconds, 12.000 MB memory used\n```\n\n\u003c/details\u003e\n\n### Check the current version of the app:\n\n```bash\n# Git version\n❯ git describe\nv1.0.1\n\n# VERSION file version\n❯ cat VERSION\n1.0.1\n```\n\n### Change version\n\nIncrease the version number according to your needs: `\u003cMAJOR\u003e`.`\u003cMINOR\u003e`.`\u003cPATCH\u003e`\n\n| Name  | Description                                                                               | Command Parameter |\n|-------|-------------------------------------------------------------------------------------------|-------------------|\n| MAJOR | is increased when API incompatible changes are released.                                  | `--major 1`       |\n| MINOR | is increased when new functionality that is compatible with the previous API is released. | `--minor 1`       |\n| PATCH | is increased when changes include API-compatible bug fixes only.                          | `--patch 1`       |\n\n* @see: https://semver.org/lang/de/\n\n### Increase the version\n\n```bash\n# Show version\n❯ cat VERSION\n1.0.2\n\n# Push changed VERSION file\n❯ git add VERSION\n❯ git commit -m \"Add version $(cat VERSION)\"\n❯ git push\n```\n\n### Tag the app (git)\n\n```bash\n# Tag and push new git tag\n❯ git tag -a \"v$(cat VERSION)\" -m \"version v$(cat VERSION)\"\n❯ git push origin \"v$(cat VERSION)\"\n```\n\n### packagist.org\n\nIf you have connected your repository to packagist.org, check the result:\n\n* https://packagist.org/\n\n## A. Authors\n\n* Björn Hempel \u003cbjoern@hempel.li\u003e - _Initial work_ - [https://github.com/bjoern-hempel](https://github.com/bjoern-hempel)\n\n## B. License\n\nThis tutorial is licensed under the MIT License - see the [LICENSE.md](/LICENSE.md) file for details\n\n## C. Closing words\n\nHave fun! :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-branch-diagram-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fixnode%2Fphp-branch-diagram-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-branch-diagram-builder/lists"}