2.0 RC 1 - new ConfigurationService (#3810)

* use html5 email validation
* remove static cache seed, for compatibility with non default (file based) caches
* added caching ConfigurationService, removed use of doctrine result cache
* simplify configuration API
This commit is contained in:
Kevin Papst
2023-02-05 19:51:08 +01:00
committed by GitHub
parent 63a3ae1147
commit ca846b5fbf
14 changed files with 119 additions and 157 deletions

View File

@@ -18,29 +18,22 @@ use App\Entity\Configuration;
class TestConfigLoader implements ConfigLoaderInterface
{
/**
* @var Configuration[]
* @var array<string, string|null>
*/
private array $configs;
private array $configs = [];
/**
* @param Configuration[] $configs
*/
public function __construct(array $configs)
{
$this->configs = $configs;
}
public function getConfiguration(string $name): ?Configuration
{
if (!\array_key_exists($name, $this->configs)) {
return null;
foreach ($configs as $config) {
$this->configs[$config->getName()] = $config->getValue();
}
return $this->configs[$name];
}
/**
* @return Configuration[]
* @return array<string, string|null>
*/
public function getConfigurations(): array
{