Skip to content

Adam314/phpgrapher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phpgrapher

What is PHPGrapher?

A tool to draw diagrams of php classes.

How it works?

Given a PHP class, PHP Grapher can draw a diagram of it's components and dependencies. Let's say we want a diagram of a MermaidHandler class from this package:

$handler = new MermaidHandler();
$traverser = new CodeTraverser($handler);
$traverser->traverseClass(MermaidHandler::class); 
echo $handler->getMermaidChart();

This will produce a diagram in mermaid format, which embeded in markdown looks like this:

flowchart TB
    MermaidHandler-->|extends class|EmptyHandler
    EmptyHandler-->|implements|HandlerInterface
    EmptyHandler-->|has method|handleClass
    EmptyHandler-->|has method|handleMethod
    EmptyHandler-->|has method|handleProperty
    EmptyHandler-->|has method|handleDependency
    EmptyHandler-->|has method|handleRelation
    MermaidHandler-->|implements|HandlerInterface
    MermaidHandler-->|has method|__construct
    MermaidHandler-->|has method|handleRelation
    MermaidHandler-->|has method|getMermaidChart
    MermaidHandler-->|has property|data
Loading

About

A tool to draw diagrams of php classes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages