super-powers/src/af0eedbe-603b-4671-8e5a-281.../code.power

77 lines
2.7 KiB
Plaintext
Raw Normal View History

2023-10-04 18:23:30 +00:00
/**
2023-10-10 09:39:09 +00:00
* Check if the registry has any content.
2023-10-04 18:23:30 +00:00
*
* @return bool Returns true if the active array is not empty, false otherwise.
* @since 3.2.0
*/
public function isActive(): bool;
/**
2023-10-10 09:39:09 +00:00
* Retrieves all value from the registry.
2023-10-04 18:23:30 +00:00
*
* @return array The values.
* @since 3.2.0
*/
public function allActive(): array;
/**
2023-10-10 09:39:09 +00:00
* Sets a value into the registry using multiple keys.
2023-10-04 18:23:30 +00:00
*
* @param mixed $value The value to set.
* @param string ...$keys The keys to determine the location.
*
* @throws \InvalidArgumentException If any of the keys are not a number or string.
* @return void
* @since 3.2.0
*/
public function setActive($value, string ...$keys): void;
/**
2023-10-10 09:39:09 +00:00
* Adds content into the registry. If a key exists,
2023-10-04 18:23:30 +00:00
* it either appends or concatenates based on the value's type.
*
2024-01-27 07:08:12 +00:00
* @param mixed $value The value to set.
* @param bool|null $asArray Determines if the new value should be treated as an array.
* Default is $addAsArray = false (if null) in base class.
* Override in child class allowed set class property $addAsArray = true.
* @param string ...$keys The keys to determine the location.
2023-10-04 18:23:30 +00:00
*
* @throws \InvalidArgumentException If any of the keys are not a number or string.
* @return void
* @since 3.2.0
*/
2024-01-27 07:08:12 +00:00
public function addActive($value, ?bool $asArray, string ...$keys): void;
2023-10-04 18:23:30 +00:00
/**
2023-10-10 09:39:09 +00:00
* Retrieves a value (or sub-array) from the registry using multiple keys.
2023-10-04 18:23:30 +00:00
*
* @param mixed $default The default value if not set.
* @param string ...$keys The keys to determine the location.
*
* @throws \InvalidArgumentException If any of the keys are not a number or string.
* @return mixed The value or sub-array from the storage. Null if the location doesn't exist.
* @since 3.2.0
*/
public function getActive($default, string ...$keys);
/**
2023-10-10 09:39:09 +00:00
* Removes a value (or sub-array) from the registry using multiple keys.
2023-10-04 18:23:30 +00:00
*
* @param string ...$keys The keys to determine the location.
*
* @throws \InvalidArgumentException If any of the keys are not a number or string.
* @return void
* @since 3.2.0
*/
public function removeActive(string ...$keys): void;
/**
2023-10-10 09:39:09 +00:00
* Checks the existence of a particular location in the registry using multiple keys.
2023-10-04 18:23:30 +00:00
*
* @param string ...$keys The keys to determine the location.
*
* @throws \InvalidArgumentException If any of the keys are not a number or string.
* @return bool True if the location exists, false otherwise.
* @since 3.2.0
*/
public function existsActive(string ...$keys): bool;