Files
kimai2/tests/Configuration/TestConfigLoader.php
2025-09-26 10:49:06 +02:00

40 lines
843 B
PHP

<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Configuration;
use App\Configuration\ConfigLoaderInterface;
use App\Entity\Configuration;
class TestConfigLoader implements ConfigLoaderInterface
{
/**
* @var array<string, string|null>
*/
private array $configs = [];
/**
* @param Configuration[] $configs
*/
public function __construct(array $configs)
{
foreach ($configs as $config) {
$this->configs[$config->getName()] = $config->getValue();
}
}
/**
* @return array<string, string|null>
*/
public function getConfigurations(): array
{
return $this->configs;
}
}