jbzoo/composer-graph

Render composer.json dependencies ad graph

1.2.0 2021-04-15 13:05 UTC

This package is auto-updated.

Last update: 2021-04-19 00:27:33 UTC


README

Build Status Coverage Status Psalm Coverage Scrutinizer Code Quality CodeFactor PHP Strict Types
Stable Version Latest Unstable Version Dependents GitHub Issues Total Downloads GitHub License

Installation

composer require        jbzoo/composer-graph # For a specific project
composer global require jbzoo/composer-graph # As global tool

# OR use phar file.
# Replace <VERSION> to the latest version. See releases page or badge above
wget https://github.com/JBZoo/Composer-Graph/releases/download/<VERSION>/composer-graph.phar

Usage

$ php ./vendor/bin/composer-graph --help

Usage:
  build [options]

Options:
  -r, --root=ROOT              The path has to contain "composer.json" and "composer.lock" files [default: "./"]
  -o, --output=OUTPUT          Path to html output. [default: "./build/composer-graph.html"]
  -f, --format=FORMAT          Output format. Available options: html,mermaid [default: "html"]
  -D, --direction=DIRECTION    Direction of graph. Available options: LR,TB,BT,RL [default: "LR"]
  -p, --show-php               Show PHP-node
  -e, --show-ext               Show all ext-* nodes (PHP modules)
  -d, --show-dev               Show all dev dependencies
  -s, --show-suggests          Show not installed suggests packages
  -l, --show-link-versions     Show version requirements in links
  -P, --show-package-versions  Show version of packages
  -O, --abc-order              Strict ABC ordering nodes in graph. It's fine tuning, sometimes it useful.
  -h, --help                   Display this help message
  -q, --quiet                  Do not output any message
  -V, --version                Display this application version
      --ansi                   Force ANSI output
      --no-ansi                Disable ANSI output
  -n, --no-interaction         Do not ask any interactive question
  -v|vv|vvv, --verbose         Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Examples

All examples are screenshots based on the package JBZoo/Toolbox.

Default output (no args) - minimal view

php ./vendor/bin/composer-graph

Example

Default output with PHP extensions (modules)

php ./vendor/bin/composer-graph  --show-ext

Example

Default output with versions of packages and relations

php ./vendor/bin/composer-graph  --show-link-versions  --show-lib-versions

Example

Show suggested packages which are not installed

php ./vendor/bin/composer-graph  --show-suggests

Example

Show dev dependencies

php ./vendor/bin/composer-graph  --show-dev

Example

Full Report

All options are enabled but --show-php (too many packages).

php ./vendor/bin/composer-graph            \
                 --show-ext                \
                 --show-dev                \
                 --show-suggests           \
                 --show-link-versions      \
                 --show-package-versions

Example

Unit tests and check code style

make update
make test-all

License

MIT