/**
* @param string $module
* @param string $format
* @return Data
*/
protected function _listFactory($module, $format)
{
$key = $module . '.' . $format;
if ($list = $this->_storage->get($key)) {
return $list;
}
if ($module === self::DEFAULT_MODULE) {
$path = $module . ':langs/' . $this->_code . '.' . $format;
} else {
$path = $module . ':langs/' . $this->_code . '.' . $module . '.' . $format;
}
$listPath = $this->_path->get($path);
// @codeCoverageIgnoreStart
if ('php' === $format) {
$list = new PHPArray($listPath);
} elseif ('json' === $format) {
$list = new JSON($listPath);
} elseif ('ini' === $format) {
$list = new Ini($listPath);
} elseif ('yml' === $format) {
$list = new Yml($listPath);
} else {
$list = new Data([]);
}
// @codeCoverageIgnoreEnd
$this->_storage->set($key, $list);
return $list;
}