93 lines
2.9 KiB
PHP
93 lines
2.9 KiB
PHP
<?php
|
|
/**
|
|
* @package Joomla.Component.Builder
|
|
*
|
|
* @created 4th September, 2022
|
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
*/
|
|
|
|
namespace VDM\Joomla\Interfaces;
|
|
|
|
|
|
/**
|
|
* The Registry Interface
|
|
*
|
|
* @since 3.2.0
|
|
*/
|
|
interface Registryinterface
|
|
{
|
|
/**
|
|
* Sets a value into the registry using multiple keys.
|
|
*
|
|
* @param string $path Registry path (e.g. vdm.content.builder)
|
|
* @param mixed $value Value of entry
|
|
*
|
|
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
|
* @return void
|
|
* @since 3.2.0
|
|
*/
|
|
public function set(string $path, $value): void;
|
|
|
|
/**
|
|
* Adds content into the registry. If a key exists,
|
|
* it either appends or concatenates based on $asArray switch.
|
|
*
|
|
* @param string $path Registry path (e.g. vdm.content.builder)
|
|
* @param mixed $value Value of entry
|
|
* @param bool $asArray Determines if the new value should be treated as an array. Default is false.
|
|
*
|
|
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
|
* @return void
|
|
* @since 3.2.0
|
|
*/
|
|
public function add(string $path, $value, bool $asArray = false): void;
|
|
|
|
/**
|
|
* Retrieves a value (or sub-array) from the registry using multiple keys.
|
|
*
|
|
* @param string $path Registry path (e.g. vdm.content.builder)
|
|
* @param mixed $default Optional default value, returned if the internal doesn't exist.
|
|
*
|
|
* @throws \InvalidArgumentException If any of the path values 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 get(string $path, $default = null);
|
|
|
|
/**
|
|
* Removes a value (or sub-array) from the registry using multiple keys.
|
|
*
|
|
* @param string $path Registry path (e.g. vdm.content.builder)
|
|
*
|
|
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
|
* @return void
|
|
* @since 3.2.0
|
|
*/
|
|
public function remove(string $path): void;
|
|
|
|
/**
|
|
* Checks the existence of a particular location in the registry using multiple keys.
|
|
*
|
|
* @param string $path Registry path (e.g. vdm.content.builder)
|
|
*
|
|
* @throws \InvalidArgumentException If any of the path values are not a number or string.
|
|
* @return bool True if the location exists, false otherwise.
|
|
* @since 3.2.0
|
|
*/
|
|
public function exists(string $path): bool;
|
|
|
|
/**
|
|
* Sets a separator value
|
|
*
|
|
* @param string|null $value The value to set.
|
|
*
|
|
* @return void
|
|
* @since 3.2.0
|
|
*/
|
|
public function setSeparator(?string $value): void;
|
|
}
|
|
|