Constants

INITIAL_ANALYSIS_TARGET_ID

INITIAL_ANALYSIS_TARGET_ID

Properties

$isSealed

$isSealed : boolean

The state of this instance

Type

boolean

$analysisTargetId

$analysisTargetId : string

Type

string — Filename or hash of input string

$requirements

$requirements : array|array<mixed,\Pvra\Result\Reasoning>

Type

array|array<mixed,\Pvra\Result\Reasoning>

$cachedRequiredVersion

$cachedRequiredVersion : string|null

Type

string|null

$cachedRequiredVersionId

$cachedRequiredVersionId : integer

Type

integer

$count

$count : integer

Number of attached reasonings.

Type

integer

Methods

getRequiredVersionId()

getRequiredVersionId() : integer

Calculate the id of the required version

Creates an integer representation of a version in the format "a.b[.c]". The third version element is optional and can be omitted. A default value of "0" will be assumed.

Throws

\Exception

Returns

integer

getMsgFormatter()

getMsgFormatter() : \Pvra\Result\MessageFormatter

Get the attached message formatter

If no message formatter has been set a default one will be created assuming default values.

Returns

\Pvra\Result\MessageFormatter

setMsgFormatter()

setMsgFormatter(\Pvra\Result\MessageFormatter  $formatter) : $this

Parameters

\Pvra\Result\MessageFormatter $formatter

Returns

$this

getRequiredVersion()

getRequiredVersion() : string

Retrieve the determined required version

This method calculates the highest required version of all known requirements. If no changes were made between the calls to this method the version requirement will not be recalculated.

Returns

string —

The required version in the format Major.Minor[.Patch]

addArbitraryRequirement()

addArbitraryRequirement(string  $version, integer  $line = -1, string  $msg = null, integer  $reason = \Pvra\Result\Reason::UNKNOWN, array  $data = array()) 

Add an arbitrary requirement identified by version

This method can be used to add an arbitrary requirement. All parameters but the first are optional

Parameters

string $version

The version in the format Major.Minor[.Patch]

integer $line

The line that caused the requirement.

string $msg

The message template that should be used. If null is passed the attached MessageLocator

will be called to retrieve a template based on the `$reason` parameter.
integer $reason

The reason for this requirement. Please be aware: Setting this parameter will not

override the required version
array $data

Additional data that should be passed to the message formatter.

addRequirement()

addRequirement(integer  $reason, integer  $line = -1, string  $msg = null, array  $data = array()) 

Add a requirement identified by reason id

This method can be used to add a requirement that is identified by its reason id.

Parameters

integer $reason

The reason for this requirement. The required version is determined from this id.

integer $line

The line that caused the requirement.

string $msg

The message template that should be used. If null is passed the attached MessageLocator

will be called to retrieve a template based on the `$reason` parameter.
array $data

Additional data that should be passed to the message formatter.

Throws

\LogicException

Thrown if the reason is unknown or does not have a version requirement associated.

isSealed()

isSealed() : boolean

Returns

boolean

getRequirements()

getRequirements() : array

Returns

array

getRequirementInfo()

getRequirementInfo(string  $version) : array|array<mixed,\Pvra\Result\Reasoning>

Get all reasonings related to a version

If no reasoning for a version is known an empty array will be returned.

Parameters

string $version

Version in the format Major.Minor.Patch

Returns

array|array<mixed,\Pvra\Result\Reasoning> —

List of Reasoning or empty array

getAnalysisTargetId()

getAnalysisTargetId() : string

Returns

string

setAnalysisTargetId()

setAnalysisTargetId(string  $analysisTargetId) : $this

Parameters

string $analysisTargetId

Returns

$this

seal()

seal() 

getIterator()

getIterator() : \ArrayIterator|array|array<mixed,\Pvra\Result\Reasoning>

Returns

\ArrayIterator|array|array<mixed,\Pvra\Result\Reasoning>

count()

count() : integer

Returns

integer

clearInstanceCaches()

clearInstanceCaches() 

Clear the cached max version requirements