Quality of life things.
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Build and test / requirements (push) Failing after 3m48s

This commit is contained in:
2024-02-07 11:00:08 +00:00
parent aed385f5e0
commit 6ce774236e
18 changed files with 226 additions and 1885 deletions

View File

@ -26,6 +26,7 @@ class App
* Create a new instance providing a config file.
*
* @param string $configFile Relative or full path to YML config.
*
* @SuppressWarnings(PHPMD.StaticAccess)
*/
public function __construct(string $configFile)
@ -60,7 +61,9 @@ class App
]);
$parser = new Yaml();
/** @var array<string, mixed> */
/**
* @var array<string, mixed>
*/
$parsedConfig = $parser->parseFile($configFile);
// Merge those values into the configuration schema:
@ -80,11 +83,14 @@ class App
* Get configuration from key
*
* @param non-empty-string $key Key to fetch
*
* @return mixed Configuration value
*/
public function getConfig(string $key): mixed
{
/** @var string|array<string, string> */
/**
* @var string|array<string, string>
*/
$ret = $this->config->get($key);
$this->logger->debug("Fetching configuration key", [$key, $ret]);
return $ret;