From 8ec1926aba549eeaea872d7dd2fcb69592b3a3bc Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 24 Jul 2023 14:07:34 +0200 Subject: [PATCH] fix(TextProcessing): Inject L10N\IFactory instead of IL10N Signed-off-by: Marcel Klehr --- lib/public/TextProcessing/FreePromptTaskType.php | 8 ++++++-- lib/public/TextProcessing/HeadlineTaskType.php | 10 +++++++--- lib/public/TextProcessing/SummaryTaskType.php | 9 +++++++-- lib/public/TextProcessing/TopicsTaskType.php | 8 ++++++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/lib/public/TextProcessing/FreePromptTaskType.php b/lib/public/TextProcessing/FreePromptTaskType.php index dcc27df77c9..a1e52e268a3 100644 --- a/lib/public/TextProcessing/FreePromptTaskType.php +++ b/lib/public/TextProcessing/FreePromptTaskType.php @@ -26,21 +26,25 @@ declare(strict_types=1); namespace OCP\TextProcessing; use OCP\IL10N; +use OCP\L10N\IFactory; /** * This is the text processing task type for free prompting * @since 27.1.0 */ class FreePromptTaskType implements ITaskType { + private IL10N $l; + /** * Constructor for FreePromptTaskType * - * @param IL10N $l + * @param IFactory $l10nFactory * @since 27.1.0 */ public function __construct( - private IL10N $l, + IFactory $l10nFactory, ) { + $this->l = $l10nFactory->get('core'); } diff --git a/lib/public/TextProcessing/HeadlineTaskType.php b/lib/public/TextProcessing/HeadlineTaskType.php index ad38848ea87..7061ca1d69b 100644 --- a/lib/public/TextProcessing/HeadlineTaskType.php +++ b/lib/public/TextProcessing/HeadlineTaskType.php @@ -26,21 +26,25 @@ declare(strict_types=1); namespace OCP\TextProcessing; use OCP\IL10N; +use OCP\L10N\IFactory; /** * This is the text processing task type for creating headline * @since 27.1.0 */ class HeadlineTaskType implements ITaskType { + private IL10N $l; + /** * Constructor for HeadlineTaskType * - * @param IL10N $l + * @param IFactory $l10nFactory * @since 27.1.0 */ public function __construct( - private IL10N $l, + IFactory $l10nFactory, ) { + $this->l = $l10nFactory->get('core'); } @@ -57,6 +61,6 @@ class HeadlineTaskType implements ITaskType { * @since 27.1.0 */ public function getDescription(): string { - return $this->l->t('Generates a possible headline for a text'); + return $this->l->t('Generates a possible headline for a text.'); } } diff --git a/lib/public/TextProcessing/SummaryTaskType.php b/lib/public/TextProcessing/SummaryTaskType.php index 3d80cee47f8..03e4b5b8ece 100644 --- a/lib/public/TextProcessing/SummaryTaskType.php +++ b/lib/public/TextProcessing/SummaryTaskType.php @@ -26,21 +26,26 @@ declare(strict_types=1); namespace OCP\TextProcessing; use OCP\IL10N; +use OCP\L10N\IFactory; /** * This is the text processing task type for summaries * @since 27.1.0 */ class SummaryTaskType implements ITaskType { + + private IL10N $l; + /** * Constructor for SummaryTaskType * - * @param IL10N $l + * @param IFactory $l10nFactory * @since 27.1.0 */ public function __construct( - private IL10N $l, + IFactory $l10nFactory, ) { + $this->l = $l10nFactory->get('core'); } diff --git a/lib/public/TextProcessing/TopicsTaskType.php b/lib/public/TextProcessing/TopicsTaskType.php index 6162b9a13e9..5a994a7a8d2 100644 --- a/lib/public/TextProcessing/TopicsTaskType.php +++ b/lib/public/TextProcessing/TopicsTaskType.php @@ -26,21 +26,25 @@ declare(strict_types=1); namespace OCP\TextProcessing; use OCP\IL10N; +use OCP\L10N\IFactory; /** * This is the text processing task type for topics extraction * @since 27.1.0 */ class TopicsTaskType implements ITaskType { + private IL10N $l; + /** * Constructor for TopicsTaskType * - * @param IL10N $l + * @param IFactory $l10nFactory * @since 27.1.0 */ public function __construct( - private IL10N $l, + IFactory $l10nFactory, ) { + $this->l = $l10nFactory->get('core'); } -- 2.39.5