\phpDocumentor\Plugin\Graphs\WriterGraph

Writer responsible for generating various graphs.

The Graph writer is capable of generating a Graph (as provided using the 'source' parameter) at the location provided using the artifact parameter.

Currently supported:

  • 'class', a Class Diagram Generated using GraphViz

Summary

Methods
Properties
Constants
checkRequirements()
transform()
processClass()
No public properties found
No constants found
checkForSpacesInPath()
createEdge()
createNamespaceGraph()
createEmptyNode()
buildNamespaceTree()
getDestinationPath()
checkIfGraphVizIsInstalled()
createGraphForNamespace()
$nodeFont
$nodeCache
$namespaceCache
N/A
No private methods found
No private properties found
N/A

Properties

$nodeFont

$nodeFont : string

Type

string — Name of the font to use to display the node labels with

$nodeCache

$nodeCache : array<mixed,\phpDocumentor\GraphViz\Node>

Type

array<mixed,\phpDocumentor\GraphViz\Node> — a cache where nodes for classes, interfaces and traits are stored for reference

$namespaceCache

$namespaceCache : array<mixed,\phpDocumentor\GraphViz\Graph>

Type

array<mixed,\phpDocumentor\GraphViz\Graph>

Methods

checkRequirements()

checkRequirements() : void

This method verifies whether PHP has all requirements needed to run this writer.

If one of the requirements is missing for this Writer then an exception of type RequirementMissing should be thrown; this indicates to the calling process that this writer will not function.

Throws

\phpDocumentor\Transformer\Writer\Exception\RequirementMissing

when a requirements is missing stating which one.

checkForSpacesInPath()

checkForSpacesInPath(string  $path) : void

Checks if there is a space in the path.

Parameters

string $path

Throws

\InvalidArgumentException

if path contains a space.

createEdge()

createEdge(\phpDocumentor\Plugin\Graphs\Writer\Graph  $graph, string  $from_name, string|\phpDocumentor\Descriptor\ClassDescriptor|\phpDocumentor\Descriptor\InterfaceDescriptor|\phpDocumentor\Descriptor\TraitDescriptor  $to) : \phpDocumentor\GraphViz\Edge

Creates a GraphViz Edge between two nodes.

Parameters

\phpDocumentor\Plugin\Graphs\Writer\Graph $graph
string $from_name
string|\phpDocumentor\Descriptor\ClassDescriptor|\phpDocumentor\Descriptor\InterfaceDescriptor|\phpDocumentor\Descriptor\TraitDescriptor $to

Returns

\phpDocumentor\GraphViz\Edge

createNamespaceGraph()

createNamespaceGraph(  $fqcn) 

Parameters

$fqcn

createEmptyNode()

createEmptyNode(string  $name, \phpDocumentor\Plugin\Graphs\Writer\Graph  $graph) : \phpDocumentor\GraphViz\Node

Parameters

string $name
\phpDocumentor\Plugin\Graphs\Writer\Graph $graph

Returns

\phpDocumentor\GraphViz\Node

buildNamespaceTree()

buildNamespaceTree(\phpDocumentor\GraphViz\Graph  $graph, \phpDocumentor\Descriptor\NamespaceDescriptor  $namespace) : void

Builds a tree of namespace subgraphs with their classes associated.

Parameters

\phpDocumentor\GraphViz\Graph $graph
\phpDocumentor\Descriptor\NamespaceDescriptor $namespace

checkIfGraphVizIsInstalled()

checkIfGraphVizIsInstalled() : void

Checks whether GraphViz is installed and throws an Exception otherwise.

Throws

\Zend\Stdlib\Exception\ExtensionNotLoadedException

if graphviz is not found.

createGraphForNamespace()

createGraphForNamespace(  $full_namespace_name,   $label) : mixed

Parameters

$full_namespace_name
$label

Returns

mixed