From f92d24e4cda03e755c66e8f41b81e982211421a2 Mon Sep 17 00:00:00 2001 From: uncleempty Date: Fri, 27 Dec 2024 16:12:14 +0100 Subject: [PATCH] chore: fix performance downgrade by reverting code to previous --- .../runner/QtiRunnerServiceContext.php | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/models/classes/runner/QtiRunnerServiceContext.php b/models/classes/runner/QtiRunnerServiceContext.php index 4d04eae58..089c801a7 100644 --- a/models/classes/runner/QtiRunnerServiceContext.php +++ b/models/classes/runner/QtiRunnerServiceContext.php @@ -47,9 +47,7 @@ use oat\taoQtiTest\models\ExtendedStateService; use oat\taoQtiTest\models\SectionPauseService; use oat\taoQtiTest\models\event\SelectAdaptiveNextItemEvent; -use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; -use Psr\Container\NotFoundExceptionInterface; use qtism\data\AssessmentTest; use qtism\data\AssessmentItemRef; use qtism\data\ExtendedAssessmentItemRef; @@ -1167,29 +1165,18 @@ private function getTestTakerFromSessionOrRds() } /** - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface + * @throws ServiceNotFoundException */ private function getSectionPauseService(): SectionPauseService { - return $this->getPsrContainer()->get(SectionPauseService::SERVICE_ID); + return $this->getServiceManager()->get(SectionPauseService::SERVICE_ID); } /** - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface + * @throws ServiceNotFoundException */ private function getCatService(): CatService { - return $this->getPsrContainer()->get(CatService::SERVICE_ID); - } - - private function getPsrContainer(): ContainerInterface - { - if (!$this->container instanceof ContainerInterface) { - $this->container = $this->getServiceManager()->getContainer(); - } - - return $this->container; + return $this->getServiceManager()->get(CatService::SERVICE_ID); } }