\Pvra\AnalysersLibraryAdditions

Class LibraryAdditions

This class may be used in conjunction with a library data provider (at this time it's just an array) to detect availability of a class or a function.

Summary

Methods
Properties
Constants
__construct()
setOwningAnalyser()
getOwningAnalyser()
enterNode()
No public properties found
No constants found
getResult()
No protected properties found
N/A
hasFunctionVersionRequirement()
getFunctionVersionRequirement()
hasClassVersionRequirement()
getClassVersionRequirement()
ensureAdditionsDataIntegrity()
$requirementAnalyser
$data
N/A

Properties

$requirementAnalyser

$requirementAnalyser : \Pvra\Analyser

The `Analyser` representing the currently running operation.

Type

\Pvra\Analyser

$data

$data : array

Type

array

Methods

__construct()

__construct(\Pvra\Analyser  $requirementAnalyser = null, string|array  $libraryData = null) 

Create an instance of the child Analyser

It is optional to set the related analyser during instance creation. When using this class in the context of an Analyser it will always be ensured that this Analyser will be known to the instance before any node is traversed.

Parameters

\Pvra\Analyser $requirementAnalyser
string|array $libraryData

setOwningAnalyser()

setOwningAnalyser(\Pvra\Analyser  $requirementAnalyser) 

Parameters

\Pvra\Analyser $requirementAnalyser

getOwningAnalyser()

getOwningAnalyser() 

enterNode()

enterNode(\PhpParser\Node  $node) : null|\PhpParser\Node

Called when entering a source node

This method is called when a source node is entered. Contained logic determines the presence of specific syntactical features.

Parameters

\PhpParser\Node $node

Returns

null|\PhpParser\Node —

The nodes should not be modified as other walkers might depend on it.

getResult()

getResult() : \Pvra\AnalysisResult

Get the instance of the currently used `Pvra\AnalysisResult`.

Returns

\Pvra\AnalysisResult

hasFunctionVersionRequirement()

hasFunctionVersionRequirement(string  $name) : boolean

Parameters

string $name

Returns

boolean

getFunctionVersionRequirement()

getFunctionVersionRequirement(string  $name) : boolean

Parameters

string $name

Returns

boolean

hasClassVersionRequirement()

hasClassVersionRequirement(string  $name) : boolean

Parameters

string $name

Returns

boolean

getClassVersionRequirement()

getClassVersionRequirement(string  $name) : boolean

Parameters

string $name

Returns

boolean

ensureAdditionsDataIntegrity()

ensureAdditionsDataIntegrity()