phpDocumentor

ProjectAnalyzer
in package

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

$descriptorCountByType  : array<string|int, int>
$elementCount  : int
$fileCount  : int
$topLevelNamespaceCount  : int
$unresolvedParentClassesCount  : int
__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, DescriptorAbstract>
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 = []

$unresolvedParentClassesCount

protected int $unresolvedParentClassesCount = 0

Methods

__toString()

Returns a textual report of the findings of this class.

public __toString() : string
Return values
string

addElementToCounter()

Increments the counter for element's class in the class counters.

protected addElementToCounter(array<string, int> $classCounters, DescriptorAbstract $element) : array<string, int>
Parameters
$classCounters : array<string, int>
$element : DescriptorAbstract
Tags
phpstan-param

array<class-string, int> $classCounters

phpstan-return

array<class-string, int>

Return values
array<string, int>

incrementUnresolvedParentCounter()

Checks whether the given element is a class and if its parent could not be resolved; increment the counter.

protected incrementUnresolvedParentCounter(DescriptorAbstract $element) : void
Parameters
$element : DescriptorAbstract
Return values
void

Search results