Class Kitab\Configuration

abstract class Configuration
{
    public function getOr(string $item, $default);
}

Configuration structure for the Kitab project.

This structure contains all the configuration items used by Kitab. All these items are public. Use it as a regular structure.

Examples

Assuming the foo item is correctly declared:

$configuration = new class () extends Kitab\Configuration {
    public $foo = null;
};
$configuration->foo = 'bar';

assert('bar' === $configuration->foo);

Methods

public function getOr(string $item, $default)

Get a configuration item value, or —if null— return a default value. If the configuration item is not set, it will be considered as null.

Examples

$configuration = new class () extends Kitab\Configuration {
    public $foo = null;
};

assert($configuration->foo === null);
assert($configuration->getOr('foo', 'foobar') === 'foobar');