Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
*/
class Config implements IManageConfigValues
{
- /**
- * @var Cache
- */
+ /** @var Cache */
protected $configCache;
/** @var ConfigFileManager */
private function loadConfigFile(string $filepath): array
{
if (file_exists($filepath)) {
- $config = include($filepath);
+ $config = include $filepath;
if (!is_array($config)) {
throw new ConfigFileException('Error loading config file ' . $filepath);
return null;
}
- switch (true) {
- // manage array value
- case preg_match("|^a:[0-9]+:{.*}$|s", $value):
- return unserialize($value);
-
- default:
- return $value;
+ if (preg_match("|^a:[0-9]+:{.*}$|s", $value)) {
+ return unserialize($value);
+ } else {
+ return $value;
}
}