skaffold / configuration
A simple configuration repository.
v0.1.0
2020-12-29 21:04 UTC
Requires
- atomastic/arrays: ^2.2
Requires (Dev)
- phpunit/phpunit: ^9.5
- vimeo/psalm: ^4.3
This package is auto-updated.
Last update: 2024-11-29 06:04:28 UTC
README
The configuration repository is a simple class and contract to handle getting and setting of configuration data.
To install
composer require skaffold/configuration
Getting started
The configuration repository accepts an optional array of initial configuration keys. From there you have several methods to assist you when interacting with the configuration data. See below.
use Skaffold\Configuration\ConfigurationRepository; $config = new ConfigurationRepository; // Sets "key" to the value of "value" $config->set('key', 'value'); // Attempts to get "key" if it is not found, defaults to "Some default value" over null $config->get('key', 'Some default value'); // Deletes the specified key from the repository $config->delete('key'); // Retrieves all the values from the repository $config->all(); // Removes all the keys from the repository $config->flush();