Add DI to ParsedLogIterator, replace constructors with fluent api

This commit is contained in:
fabrixxm 2021-08-19 13:03:45 +02:00
parent a62124285d
commit ec4f53d56f
5 changed files with 88 additions and 27 deletions

View file

@ -71,7 +71,11 @@ class View extends BaseAdmin
$error = DI::l10n()->t('Error trying to open <strong>%1$s</strong> log file.\r\n<br/>Check to see if file %1$s exist and is readable.', $f);
} else {
try {
$data = new ParsedLogIterator($f, self::LIMIT, $filters, $search);
$data = DI::parsedLogIterator()
->open($f)
->withLimit(self::LIMIT)
->withFilters($filters)
->withSearch($search);
} catch (Exception $e) {
$error = DI::l10n()->t('Couldn\'t open <strong>%1$s</strong> log file.\r\n<br/>Check to see if file %1$s is readable.', $f);
}