RprtCli/app/src/Utils/Configuration/ConfigurationInterface.php

36 lines
744 B
PHP
Raw Normal View History

2021-04-05 16:23:06 +02:00
<?php
2021-09-20 01:08:42 +02:00
declare(strict_types=1);
2021-04-05 16:23:06 +02:00
// src/Utils/Configuration/ConfigurationInterface.php
namespace RprtCli\Utils\Configuration;
2021-04-05 17:20:59 +02:00
interface ConfigurationInterface
2021-04-05 16:23:06 +02:00
{
/**
* Get and read the configuration from file.
*/
2021-09-20 01:08:42 +02:00
public function getConfig() : bool;
2021-04-05 16:23:06 +02:00
/**
* Get a specific configuration for key.
*
2021-09-20 01:08:42 +02:00
* @param string $key
2021-04-05 16:23:06 +02:00
* Config key.
2021-09-20 01:08:42 +02:00
* @param null|mixed $default
2021-04-05 16:23:06 +02:00
* Default value if config for key is not yet specified.
* @return mixed
* Data.
*/
public function get($key, $default = null);
/**
* Checks if key exists in the configuration file.
*
* @param string $key
* Key to check for.
*/
2021-09-20 01:08:42 +02:00
public function exists($key) : bool;
2021-04-05 16:23:06 +02:00
}