GraphVizClassDiagram
in package
implements
Generator
Interfaces, Classes and Traits
Table of Contents
- $namespaceCache : array<string|int, Graph>
- $nodeCache : array<string, ?\phpDocumentor\GraphViz\Node>
- create() : void
- Creates a class inheritance diagram.
- buildNamespaceTree() : void
- Builds a tree of namespace subgraphs with their classes associated.
- checkIfGraphVizIsInstalled() : void
- Checks whether GraphViz is installed and throws an Exception otherwise.
- createEdge() : Edge|null
- Creates a GraphViz Edge between two nodes.
- createEmptyNode() : Node|null
- createGraphForNamespace() : Graph
- createNamespaceGraph() : Graph|null
Properties
$namespaceCache
private
array<string|int, Graph>
$namespaceCache
= []
$nodeCache
private
array<string, ?\phpDocumentor\GraphViz\Node>
$nodeCache
= []
a cache where nodes for classes, interfaces and traits are stored for reference
Methods
create()
Creates a class inheritance diagram.
public
create(ProjectDescriptor $project, string $filename) : void
Parameters
- $project : ProjectDescriptor
- $filename : string
Return values
void —buildNamespaceTree()
Builds a tree of namespace subgraphs with their classes associated.
private
buildNamespaceTree(Graph $graph, NamespaceInterface $namespace) : void
Parameters
- $graph : Graph
- $namespace : NamespaceInterface
Return values
void —checkIfGraphVizIsInstalled()
Checks whether GraphViz is installed and throws an Exception otherwise.
private
checkIfGraphVizIsInstalled() : void
Tags
Return values
void —createEdge()
Creates a GraphViz Edge between two nodes.
private
createEdge(string $fromName, string|ClassDescriptor|InterfaceDescriptor|TraitDescriptor $to) : Edge|null
Parameters
- $fromName : string
- $to : string|ClassDescriptor|InterfaceDescriptor|TraitDescriptor
Return values
Edge|null —createEmptyNode()
private
createEmptyNode(string $name, Graph|null $graph) : Node|null
Parameters
- $name : string
- $graph : Graph|null
Return values
Node|null —createGraphForNamespace()
private
createGraphForNamespace(string $fullNamespaceName, string $label) : Graph
Parameters
- $fullNamespaceName : string
- $label : string
Return values
Graph —createNamespaceGraph()
private
createNamespaceGraph(string $fqcn) : Graph|null
Parameters
- $fqcn : string