More code standards
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-06-05 09:40:04 +00:00
parent 668c375f4b
commit 9d0d188d01
6 changed files with 95 additions and 54 deletions

View File

@ -8,11 +8,25 @@ use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Psr\Log\NullLogger;
/**
* Application class
*
* Mostly working as a register pattern for the logging and configuration.
*
* @author Jens True <jens.chr.true@gmail.com>
* @license https://opensource.org/licenses/gpl-license.php GNU Public License
* @link https://jcktrue.dk
*/
class App
{
protected Logger $logger;
protected array $config;
/**
* Create a new instance providing a config file
*
* @param string $configFile Relative or full path to YML config.
*/
function __construct(string $configFile)
{
$this->config = Yaml::parseFile($configFile);
@ -26,12 +40,21 @@ class App
$this->logger = $logger;
}
/**
* Get the full configuration
*
* @return array Full configuration structure
*/
function getConfig() : array
{
return $this->config;
}
/**
* Get the logger instance.
*
* @return Logger Instance of logger
*/
function getLogger() : Logger
{
return $this->logger;