misuzu/src/Config/IConfig.php

18 lines
798 B
PHP

<?php
namespace Misuzu\Config;
// getValue (and hasValue?) should probably be replaced with something that allows grouped loading
// that way the entire config doesn't have to be kept in memory on every request
// this probably has to be delayed until the backwards compat static Config object isn't needed anymore
// otherwise there'd be increased overhead
// bulk operations for setValue and removeValue would also be cool
interface IConfig {
function scopeTo(string $prefix): IConfig;
function getNames(): array;
function getValue(string $name, string $type = CfgType::T_ANY, $default = null): mixed;
function hasValue(string $name): bool;
function setValue(string $name, $value, bool $save = true): void;
function removeValue(string $name, bool $save = true): void;
}