visuddhinanda 6 дней назад
Родитель
Сommit
dc69aa24c8
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      api-v12/app/Services/AIAssistant/ArticleTranslateService.php

+ 3 - 3
api-v12/app/Services/AIAssistant/ArticleTranslateService.php

@@ -82,14 +82,14 @@ class ArticleTranslateService
         $this->outputChannelId = $id;
         return $this;
     }
-    public function translateAnthology($anthologyId, ?callable $fn = null): int
+    public function translateAnthology($anthologyId, ?callable $onEach = null): int
     {
         $articles = $this->articleService->articlesInAnthology($anthologyId);
 
         foreach ($articles as $article) {
             $sentences = $this->translateArticle($article)->save();
-            if ($fn) {
-                $fn($article, $sentences);
+            if ($onEach) {
+                $onEach($article, $sentences);
             }
         }