Quality of life things.
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Build and test / requirements (push) Failing after 3m48s
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Build and test / requirements (push) Failing after 3m48s
This commit is contained in:
10
src/App.php
10
src/App.php
@ -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;
|
||||
|
Reference in New Issue
Block a user