|
22 | 22 | use Chamilo\CoreBundle\Helpers\CourseStudentInfoHelper; |
23 | 23 | use Chamilo\CoreBundle\Helpers\UserHelper; |
24 | 24 | use Chamilo\CoreBundle\Repository\AssetRepository; |
25 | | -use Chamilo\CoreBundle\Repository\CourseCategoryRepository; |
26 | 25 | use Chamilo\CoreBundle\Repository\ExtraFieldValuesRepository; |
27 | 26 | use Chamilo\CoreBundle\Repository\LanguageRepository; |
28 | 27 | use Chamilo\CoreBundle\Repository\LegalRepository; |
|
73 | 72 | use Symfony\Component\Serializer\SerializerInterface; |
74 | 73 | use Symfony\Component\Validator\Exception\ValidatorException; |
75 | 74 | use Symfony\Contracts\Translation\TranslatorInterface; |
| 75 | +use Throwable; |
76 | 76 | use UserManager; |
77 | 77 |
|
78 | 78 | /** |
@@ -1193,14 +1193,14 @@ public function studentInfoBatchJson( |
1193 | 1193 | $sessionId = (int) ($payload['sid'] ?? 0); |
1194 | 1194 |
|
1195 | 1195 | $courseIds = $payload['courseIds'] ?? []; |
1196 | | - if (!is_array($courseIds)) { |
| 1196 | + if (!\is_array($courseIds)) { |
1197 | 1197 | $courseIds = []; |
1198 | 1198 | } |
1199 | 1199 |
|
1200 | 1200 | $courseIds = array_values(array_unique(array_map('intval', $courseIds))); |
1201 | 1201 | $courseIds = array_filter($courseIds, static fn (int $id) => $id > 0); |
1202 | | - if (count($courseIds) > 300) { |
1203 | | - $courseIds = array_slice($courseIds, 0, 300); |
| 1202 | + if (\count($courseIds) > 300) { |
| 1203 | + $courseIds = \array_slice($courseIds, 0, 300); |
1204 | 1204 | } |
1205 | 1205 |
|
1206 | 1206 | if (empty($courseIds)) { |
@@ -1232,7 +1232,7 @@ public function studentInfoBatchJson( |
1232 | 1232 | if (0 === $sessionId) { |
1233 | 1233 | try { |
1234 | 1234 | $this->denyAccessUnlessGranted(CourseVoter::VIEW, $course); |
1235 | | - } catch (\Throwable $e) { |
| 1235 | + } catch (Throwable $e) { |
1236 | 1236 | // Skip unauthorized courses without failing the whole batch. |
1237 | 1237 | continue; |
1238 | 1238 | } |
|
0 commit comments