ProjectAnalyzer
in package
implements
Stringable
Analyzes a Project Descriptor and collects key information.
This class can be used by external tools to analyze the Project Descriptor and collect key information from it such as the total number of elements per type of Descriptor, the number of top level namespaces or the number of parent classes that could not be interpreted by the Compiler passes.
Table of Contents
Interfaces
- Stringable
Properties
- $descriptorCountByType : array<string|int, int>
- $fileCount : int
- $topLevelNamespaceCount : int
- $unresolvedParentClassesCount : int
Methods
- __toString() : string
- Returns a textual report of the findings of this class.
- analyze() : void
- Analyzes the given project descriptor and populates this object's properties.
- addElementToCounter() : array<string, int>
- Increments the counter for element's class in the class counters.
- findAllElements() : Collection<string|int, ElementInterface>
- Returns all elements from the project descriptor.
- incrementUnresolvedParentCounter() : void
- Checks whether the given element is a class and if its parent could not be resolved; increment the counter.
Properties
$descriptorCountByType
protected
array<string|int, int>
$descriptorCountByType
= []
$fileCount
protected
int
$fileCount
= 0
$topLevelNamespaceCount
protected
int
$topLevelNamespaceCount
= 0
$unresolvedParentClassesCount
protected
int
$unresolvedParentClassesCount
= 0
Methods
__toString()
Returns a textual report of the findings of this class.
public
__toString() : string
Return values
stringanalyze()
Analyzes the given project descriptor and populates this object's properties.
public
analyze(DocumentationSetDescriptor $documentationSet) : void
Parameters
- $documentationSet : DocumentationSetDescriptor
addElementToCounter()
Increments the counter for element's class in the class counters.
protected
addElementToCounter(array<string, int> $classCounters, ElementInterface $element) : array<string, int>
Parameters
- $classCounters : array<string, int>
- $element : ElementInterface
Tags
Return values
array<string, int>findAllElements()
Returns all elements from the project descriptor.
protected
findAllElements(DocumentationSetDescriptor $documentationSet) : Collection<string|int, ElementInterface>
Parameters
- $documentationSet : DocumentationSetDescriptor
Return values
Collection<string|int, ElementInterface>incrementUnresolvedParentCounter()
Checks whether the given element is a class and if its parent could not be resolved; increment the counter.
protected
incrementUnresolvedParentCounter(ElementInterface $element) : void
Parameters
- $element : ElementInterface