phpDocumentor

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 = []

$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, ElementInterface $element) : array<string, int>
Parameters
$classCounters : array<string, int>
$element : ElementInterface
Tags
phpstan-param

array<class-string<ElementInterface>, int> $classCounters

phpstan-return

array<class-string<ElementInterface>, 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(ElementInterface $element) : void
Parameters
$element : ElementInterface

        
On this page

Search results