diff --git a/src/CoreBundle/AiProvider/AiTutorChatService.php b/src/CoreBundle/AiProvider/AiTutorChatService.php index f8a648f6736..263c1e90771 100644 --- a/src/CoreBundle/AiProvider/AiTutorChatService.php +++ b/src/CoreBundle/AiProvider/AiTutorChatService.php @@ -22,6 +22,7 @@ use Symfony\Component\HttpFoundation\RequestStack; use Throwable; +use const DATE_ATOM; use const ENT_QUOTES; use const ENT_SUBSTITUTE; diff --git a/src/CoreBundle/Controller/AiController.php b/src/CoreBundle/Controller/AiController.php index 22f70165ee8..2f16b6053ba 100644 --- a/src/CoreBundle/Controller/AiController.php +++ b/src/CoreBundle/Controller/AiController.php @@ -4138,6 +4138,7 @@ private function archiveCourseAnalyzerResult( ) { $relation->addTag($tag); $this->em->persist($relation); + break; } } diff --git a/src/CoreBundle/Controller/ChatController.php b/src/CoreBundle/Controller/ChatController.php index 5d09ed1700e..5df3b9e1fea 100644 --- a/src/CoreBundle/Controller/ChatController.php +++ b/src/CoreBundle/Controller/ChatController.php @@ -46,6 +46,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; use Throwable; +use const DATE_ATOM; use const ENT_QUOTES; use const ENT_SUBSTITUTE; use const JSON_UNESCAPED_SLASHES; @@ -1678,7 +1679,7 @@ private function getGlobalAiTutorArchiveMessages(ManagerRegistry $doctrine, int } /** - * @param list $messages + * @param list $messages * @param array{source:string,mode:string,course_id:int,session_id:int,conversation_id:int,provider:string,path:string} $metadata */ private function buildAiTutorArchiveHtml( @@ -1759,6 +1760,7 @@ private function tagAiTutorArchiveMessage( $relation->addTag($tag); $entityManager->persist($relation); $entityManager->flush(); + break; } } diff --git a/src/CoreBundle/Mcp/GenerateStudentSuccessFeedbackTool.php b/src/CoreBundle/Mcp/GenerateStudentSuccessFeedbackTool.php index 1e4b75f81c0..e299bff8817 100644 --- a/src/CoreBundle/Mcp/GenerateStudentSuccessFeedbackTool.php +++ b/src/CoreBundle/Mcp/GenerateStudentSuccessFeedbackTool.php @@ -71,11 +71,7 @@ public function generateStudentSuccessFeedback( } catch (AccessDeniedException|InvalidArgumentException|RuntimeException $exception) { throw new ToolCallException($exception->getMessage()); } catch (Throwable $throwable) { - throw new ToolCallException( - 'The Student Success feedback could not be generated because of an unexpected server error. Check the Chamilo log for technical details.', - 0, - $throwable, - ); + throw new ToolCallException('The Student Success feedback could not be generated because of an unexpected server error. Check the Chamilo log for technical details.', 0, $throwable); } } @@ -108,9 +104,7 @@ private function doGenerateStudentSuccessFeedback( $teacherPrompt = trim($teacherPrompt); if (mb_strlen($teacherPrompt) > self::MAX_TEACHER_PROMPT_LENGTH) { - throw new InvalidArgumentException( - sprintf('Additional instructions must be %d characters or fewer.', self::MAX_TEACHER_PROMPT_LENGTH), - ); + throw new InvalidArgumentException(\sprintf('Additional instructions must be %d characters or fewer.', self::MAX_TEACHER_PROMPT_LENGTH)); } $provider = null === $provider ? null : trim($provider); diff --git a/src/CoreBundle/Service/StudentSuccess/StudentSuccessCoach.php b/src/CoreBundle/Service/StudentSuccess/StudentSuccessCoach.php index fc4addc11d1..6eda1fa7999 100644 --- a/src/CoreBundle/Service/StudentSuccess/StudentSuccessCoach.php +++ b/src/CoreBundle/Service/StudentSuccess/StudentSuccessCoach.php @@ -337,7 +337,7 @@ private function systemPrompt(Course $course, array $evidenceSources): string } /** - * @param array $raw + * @param array $raw * @param array $evidenceSources * * @return array diff --git a/tests/CoreBundle/Mcp/GenerateStudentSuccessFeedbackToolTest.php b/tests/CoreBundle/Mcp/GenerateStudentSuccessFeedbackToolTest.php index fc85da241b7..5f121f6b9a1 100644 --- a/tests/CoreBundle/Mcp/GenerateStudentSuccessFeedbackToolTest.php +++ b/tests/CoreBundle/Mcp/GenerateStudentSuccessFeedbackToolTest.php @@ -48,8 +48,6 @@ private function createToolWithoutDependencies(): GenerateStudentSuccessFeedback $reflection = new ReflectionClass(GenerateStudentSuccessFeedbackTool::class); /** @var GenerateStudentSuccessFeedbackTool $tool */ - $tool = $reflection->newInstanceWithoutConstructor(); - - return $tool; + return $reflection->newInstanceWithoutConstructor(); } }