Skip to content

DependencyManager

DependencyManager handles the dependencies in the validation process

class DependencyManager implements ResetInterface

ImplementsResetInterface
Since1.0.0
SourceValidator/DependencyManager.php
MethodDescription
addDependTokens(array<int, string> $tokens, VirtualArrayPath $base): voidPuts a list of tokens into the dependency cache.
checkDependencies(array<int, string> $tokens, VirtualArrayPath $base): boolChecks whether a list of dependencies is met.
clear(): voidClears the dependency cache.
[`getDependTokens(): array<intstring, mixed>`](#getdependtokens)
populateArgumentBaseKeyRefs(string $string): stringPopulate key references in an argument base string if necessary.
reset(): voidDiscards every dependency token collected so far, by delegating to DependencyManager::clear().

public function addDependTokens(array<int, string> $tokens, VirtualArrayPath $base): void

Puts a list of tokens into the dependency cache.

The base path to which all tokens are appended.

ParameterTypeDescription
$tokensarray``<``int``, ``string``>The list of new tokens.
$baseVirtualArrayPathThe base path to which all tokens are appended.

public function checkDependencies(array<int, string> $tokens, VirtualArrayPath $base): bool

Checks whether a list of dependencies is met.

The base path to which all tokens are appended.

ParameterTypeDescription
$tokensarray``<``int``, ``string``>The list of dependencies that have to meet.
$baseVirtualArrayPathThe base path to which all tokens are appended.

Returns bool — all dependencies are met

public function clear(): void

Clears the dependency cache.

public function getDependTokens(): array<int|string, mixed>

Returns the list of provided tokens from the dependency cache.

Returns array``<``int``|``string``, ``mixed``> — Provided tokens from the dependency cache.

public static function populateArgumentBaseKeyRefs(string $string): string

Populate key references in an argument base string if necessary.

The argument base string.

ParameterTypeDescription
$stringstringThe argument base string.

Returns string — The argument base string with empty brackets filled with correct sprintf() position specifiers.

public function reset(): void

Discards every dependency token collected so far, by delegating to DependencyManager::clear().