DependencyManager
DependencyManager handles the dependencies in the validation process
Synopsis
Section titled “Synopsis”class DependencyManager implements ResetInterface
| Implements | ResetInterface |
| Since | 1.0.0 |
| Source | Validator/DependencyManager.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
addDependTokens(array<int, string> $tokens, VirtualArrayPath $base): void | Puts a list of tokens into the dependency cache. |
checkDependencies(array<int, string> $tokens, VirtualArrayPath $base): bool | Checks whether a list of dependencies is met. |
clear(): void | Clears the dependency cache. |
| [`getDependTokens(): array<int | string, mixed>`](#getdependtokens) |
populateArgumentBaseKeyRefs(string $string): string | Populate key references in an argument base string if necessary. |
reset(): void | Discards every dependency token collected so far, by delegating to DependencyManager::clear(). |
addDependTokens()
Section titled “addDependTokens()”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.
| Parameter | Type | Description |
|---|---|---|
$tokens | array``<``int``, ``string``> | The list of new tokens. |
$base | VirtualArrayPath | The base path to which all tokens are appended. |
checkDependencies()
Section titled “checkDependencies()”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.
| Parameter | Type | Description |
|---|---|---|
$tokens | array``<``int``, ``string``> | The list of dependencies that have to meet. |
$base | VirtualArrayPath | The base path to which all tokens are appended. |
Returns bool — all dependencies are met
clear()
Section titled “clear()”public function clear(): void
Clears the dependency cache.
getDependTokens()
Section titled “getDependTokens()”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.
populateArgumentBaseKeyRefs()
Section titled “populateArgumentBaseKeyRefs()”public static function populateArgumentBaseKeyRefs(string $string): string
Populate key references in an argument base string if necessary.
The argument base string.
| Parameter | Type | Description |
|---|---|---|
$string | string | The argument base string. |
Returns string — The argument base string with empty brackets filled with correct sprintf() position specifiers.
reset()
Section titled “reset()”public function reset(): void
Discards every dependency token collected so far, by delegating to DependencyManager::clear().