Skip to content

Commit 4eca2af

Browse files
committed
Cron: use ilSetupLanguage in Objective
1 parent f63345b commit 4eca2af

2 files changed

Lines changed: 2 additions & 18 deletions

File tree

components/ILIAS/Cron/classes/Setup/class.ilCronJobsRegisteredObjective.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,11 @@ public function achieve(Setup\Environment $environment): Setup\Environment
7676
/** @var ilSettingsFactory $settings_factory */
7777
$settings_factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
7878

79-
$mock_lng = new class () implements \ILIAS\Language\Language {
80-
public function txt(string $a_topic, string $a_default_lang_fallback_mod = ""): string
81-
{
82-
return '';
83-
}
84-
public function loadLanguageModule(string $a_module): void
85-
{
86-
}
87-
public function getLangKey(): string
88-
{
89-
}
90-
public function toJS($key): void
91-
{
92-
}
93-
};
94-
9579
$mock_logger_factory = new class () implements \ILIAS\Logging\LoggerFactory {
9680
};
9781

9882
$registry = new ILIAS\Cron\CronRegistry($this->cronjobs);
83+
$language = new ilSetupLanguage('en');
9984

10085
$repo = new ilCronJobRepositoryImpl(
10186
$registry,
@@ -104,7 +89,7 @@ public function toJS($key): void
10489
new ILIAS\components\Logging\NullLogger(),
10590
$component_repository,
10691
$component_factory,
107-
$mock_lng,
92+
$language,
10893
$mock_logger_factory
10994
);
11095

components/ILIAS/Cron/classes/class.ilCronJobEntities.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public function add(ilCronJobEntity $job): void
4747

4848
public function filter(callable $callable): ilCronJobCollection
4949
{
50-
5150
return new static(...array_filter($this->jobs, $callable));
5251
}
5352

0 commit comments

Comments
 (0)