diff options
author | Marcel Klehr <mklehr@gmx.net> | 2023-07-24 14:07:34 +0200 |
---|---|---|
committer | Julien Veyssier <julien-nc@posteo.net> | 2023-08-02 12:37:35 +0200 |
commit | 8ec1926aba549eeaea872d7dd2fcb69592b3a3bc (patch) | |
tree | 86912d8343a363ed65a569f8bc94ccc65365ba63 /lib/public/TextProcessing | |
parent | 4e33d044443973f2fc82e74bca0bc43e845a36e7 (diff) | |
download | nextcloud-server-8ec1926aba549eeaea872d7dd2fcb69592b3a3bc.tar.gz nextcloud-server-8ec1926aba549eeaea872d7dd2fcb69592b3a3bc.zip |
fix(TextProcessing): Inject L10N\IFactory instead of IL10N
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/public/TextProcessing')
-rw-r--r-- | lib/public/TextProcessing/FreePromptTaskType.php | 8 | ||||
-rw-r--r-- | lib/public/TextProcessing/HeadlineTaskType.php | 10 | ||||
-rw-r--r-- | lib/public/TextProcessing/SummaryTaskType.php | 9 | ||||
-rw-r--r-- | 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'); } |