Git Product home page Git Product logo

dependency-visualizer's Introduction

Dependency Visualizer

phpunit

Overview

Dependency Visualizer is a tool that visualizes dependency among classes.

This tool is experimental and possesses only basic functionality. For example, it doesn't have a mechanism to resolve expressions and infer types, nor does it interpret PHPDoc.

Installation

  1. Edit composer.json

    {
        "repositories": [
            {
                "type": "vcs",
                "url": "https://github.com/hirokinoue/dependency-visualizer"
            }
        ],
        "minimum-stability": "dev",
        "prefer-stable": true
    }
    

    Please note that this tool is experimental. Consider whether your project can accept a minimum stability of 'dev' before installing it.

  2. Install using composer
    $ composer require --dev hirokinoue/dependency-visualizer

Configuration

Add a config.php, config.php.dist or config.dist.php to the directory from which you run dependency-visualizer.

config.php looks like this:

<?php declare(strict_types=1);
return $config = [
    'memoryLimit' => '1024M',
    // Specify the number of depths to analyze in the dependency hierarchy.
    'maxDepth' => 5,
    // Specify a part of a namespace to exclude classes from the analysis.
    // For example, when dependencies of third-party packages are not wanted to be analyzed.
    // Classes starting with the given namespace will not be analyzed and classes they depend on will not.
    // Note that if A depends on B and C, and B depends on C, and B is excluded,
    // the dependence from A to C will be shown, but the dependence from B to C will not be shown.
    'endOfAnalysis' => [
        'Foo\\',
    ],
    // Specify a part of a namespace.
    // Classes starting with the given namespace will not be analyzed.
    'excludeFromAnalysis' => [
        'Foo\Bar\\',
    // Specify the relative path from the directory where the application is executed.
    'excludeFilePath' => [
        '',
    ],
];

Usage

$ ./vendor/bin/dependency-visualizer -h

Usage: dependency-visualizer [options] <target php file>
Options:
  -d: Load Xdebug.
  -h: Show this help.
  -l: Output log to current directory.
  -m: Draw methods in diagram.
  -s: Output analysis results in string format.

Example

example image

Items that cannot be distinguished as concrete class, abstract class, interface, trait or enum are drawn as stereotype.

dependency-visualizer's People

Contributors

hirokinoue avatar

Stargazers

smeghead avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.