From 5769da2729d30bf75d2fbee8b5a73bf4e10615fb Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Sun, 7 Apr 2024 16:41:52 -0500 Subject: [PATCH] Minor: Format code --- src/CoreBundle/Controller/AccountController.php | 2 +- src/CoreBundle/Controller/NewsController.php | 3 +-- .../Controller/PlatformConfigurationController.php | 4 +--- src/CoreBundle/Controller/ResourceController.php | 3 +-- src/CoreBundle/Controller/SecurityController.php | 1 - src/CoreBundle/Controller/SocialController.php | 2 +- src/CoreBundle/Controller/TemplateController.php | 1 - src/CoreBundle/Entity/GradebookCategory.php | 1 - src/CoreBundle/Entity/Message.php | 3 --- src/CoreBundle/EventListener/TwigListener.php | 2 -- src/CoreBundle/EventSubscriber/AnonymousUserSubscriber.php | 3 +-- src/CoreBundle/Framework/Container.php | 3 --- .../Migrations/Schema/V200/Version20201212195011.php | 2 -- .../Migrations/Schema/V200/Version20201215142610.php | 1 - .../Migrations/Schema/V200/Version20201215153517.php | 1 - .../Migrations/Schema/V200/Version20201216132000.php | 1 - .../Migrations/Schema/V200/Version20201217124011.php | 2 -- .../Migrations/Schema/V200/Version20210205082253.php | 1 - .../Migrations/Schema/V200/Version20210221082033.php | 1 - .../Migrations/Schema/V200/Version20210923090920.php | 1 - .../Migrations/Schema/V200/Version20210930130343.php | 2 -- .../Migrations/Schema/V200/Version20211005154000.php | 1 - .../Migrations/Schema/V200/Version20230215072918.php | 3 --- .../Migrations/Schema/V200/Version20230216122900.php | 1 - .../Migrations/Schema/V200/Version20230321164019.php | 1 - .../Migrations/Schema/V200/Version20230720222140.php | 1 - .../Migrations/Schema/V200/Version20230913162700.php | 1 - .../Migrations/Schema/V200/Version20231012185600.php | 1 - .../Migrations/Schema/V200/Version20231026231100.php | 1 - .../Migrations/Schema/V200/Version20240112103400.php | 1 - .../Migrations/Schema/V200/Version20240112191200.php | 6 ------ .../Migrations/Schema/V200/Version20240128205500.php | 1 - .../Migrations/Schema/V200/Version20240130161800.php | 1 - .../Migrations/Schema/V200/Version20240202122300.php | 1 - src/CoreBundle/ServiceHelper/TicketProjectHelper.php | 7 +++++-- src/CoreBundle/ServiceHelper/UserHelper.php | 2 +- 36 files changed, 12 insertions(+), 57 deletions(-) diff --git a/src/CoreBundle/Controller/AccountController.php b/src/CoreBundle/Controller/AccountController.php index 210ebfd642..ddb27cea7d 100644 --- a/src/CoreBundle/Controller/AccountController.php +++ b/src/CoreBundle/Controller/AccountController.php @@ -29,7 +29,7 @@ class AccountController extends BaseController public function __construct( private readonly UserHelper $userHelper, - ) { } + ) {} #[Route('/edit', name: 'chamilo_core_account_edit', methods: ['GET', 'POST'])] public function edit(Request $request, UserRepository $userRepository, IllustrationRepository $illustrationRepo, SettingsManager $settingsManager): Response diff --git a/src/CoreBundle/Controller/NewsController.php b/src/CoreBundle/Controller/NewsController.php index 7e94726ceb..1decea729b 100644 --- a/src/CoreBundle/Controller/NewsController.php +++ b/src/CoreBundle/Controller/NewsController.php @@ -6,7 +6,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Controller; -use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\SysAnnouncementRepository; use Chamilo\CoreBundle\ServiceHelper\AccessUrlHelper; use Chamilo\CoreBundle\ServiceHelper\UserHelper; @@ -26,7 +25,7 @@ class NewsController extends BaseController public function __construct( private readonly AccessUrlHelper $accessUrlHelper, private readonly UserHelper $userHelper, - ) { } + ) {} #[Route('/list', name: 'news_index', methods: ['GET'])] public function index(SysAnnouncementRepository $sysAnnouncementRepository): Response diff --git a/src/CoreBundle/Controller/PlatformConfigurationController.php b/src/CoreBundle/Controller/PlatformConfigurationController.php index 5398216a22..7e709219da 100644 --- a/src/CoreBundle/Controller/PlatformConfigurationController.php +++ b/src/CoreBundle/Controller/PlatformConfigurationController.php @@ -7,7 +7,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Controller; use bbb; -use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\ServiceHelper\TicketProjectHelper; use Chamilo\CoreBundle\ServiceHelper\UserHelper; use Chamilo\CoreBundle\Settings\SettingsManager; @@ -16,7 +15,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -use TicketManager; #[Route('/platform-config')] class PlatformConfigurationController extends AbstractController @@ -26,7 +24,7 @@ class PlatformConfigurationController extends AbstractController public function __construct( private readonly TicketProjectHelper $ticketProjectHelper, private readonly UserHelper $userHelper, - ) { } + ) {} #[Route('/list', name: 'platform_config_list', methods: ['GET'])] public function list(SettingsManager $settingsManager): Response diff --git a/src/CoreBundle/Controller/ResourceController.php b/src/CoreBundle/Controller/ResourceController.php index ae88743ddb..c021ed1dc2 100644 --- a/src/CoreBundle/Controller/ResourceController.php +++ b/src/CoreBundle/Controller/ResourceController.php @@ -12,7 +12,6 @@ use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\TrackEDownloads; use Chamilo\CoreBundle\Entity\User; -use Chamilo\CoreBundle\Repository\ResourceFactory; use Chamilo\CoreBundle\Repository\ResourceWithLinkInterface; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; use Chamilo\CoreBundle\ServiceHelper\UserHelper; @@ -58,7 +57,7 @@ class ResourceController extends AbstractResourceController implements CourseCon public function __construct( private readonly UserHelper $userHelper, - ) { } + ) {} #[Route(path: '/{tool}/{type}/{id}/disk_space', methods: ['GET', 'POST'], name: 'chamilo_core_resource_disk_space')] public function diskSpace(Request $request): Response diff --git a/src/CoreBundle/Controller/SecurityController.php b/src/CoreBundle/Controller/SecurityController.php index fc67667742..501afe4b70 100644 --- a/src/CoreBundle/Controller/SecurityController.php +++ b/src/CoreBundle/Controller/SecurityController.php @@ -8,7 +8,6 @@ namespace Chamilo\CoreBundle\Controller; use Chamilo\CoreBundle\Entity\ExtraFieldValues; use Chamilo\CoreBundle\Entity\Legal; -use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\TrackELoginRecordRepository; use Chamilo\CoreBundle\ServiceHelper\UserHelper; use Chamilo\CoreBundle\Settings\SettingsManager; diff --git a/src/CoreBundle/Controller/SocialController.php b/src/CoreBundle/Controller/SocialController.php index f372b3b00f..6a14eff47a 100644 --- a/src/CoreBundle/Controller/SocialController.php +++ b/src/CoreBundle/Controller/SocialController.php @@ -50,7 +50,7 @@ class SocialController extends AbstractController { public function __construct( private readonly UserHelper $userHelper, - ) { } + ) {} #[Route('/personal-data/{userId}', name: 'chamilo_core_social_personal_data')] public function getPersonalData( diff --git a/src/CoreBundle/Controller/TemplateController.php b/src/CoreBundle/Controller/TemplateController.php index b5285542b3..23baaa19ad 100644 --- a/src/CoreBundle/Controller/TemplateController.php +++ b/src/CoreBundle/Controller/TemplateController.php @@ -9,7 +9,6 @@ namespace Chamilo\CoreBundle\Controller; use Chamilo\CoreBundle\Entity\Asset; use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Templates; -use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\AssetRepository; use Chamilo\CoreBundle\Repository\Node\CourseRepository; use Chamilo\CoreBundle\Repository\SystemTemplateRepository; diff --git a/src/CoreBundle/Entity/GradebookCategory.php b/src/CoreBundle/Entity/GradebookCategory.php index e92cb81944..dd589a83bd 100644 --- a/src/CoreBundle/Entity/GradebookCategory.php +++ b/src/CoreBundle/Entity/GradebookCategory.php @@ -6,7 +6,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Entity; -use ApiPlatform\Core\Annotation\ApiSubresource; use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiResource; diff --git a/src/CoreBundle/Entity/Message.php b/src/CoreBundle/Entity/Message.php index 7251498e1c..3990c190f0 100644 --- a/src/CoreBundle/Entity/Message.php +++ b/src/CoreBundle/Entity/Message.php @@ -435,9 +435,6 @@ class Message return $this; } - /** - * @return Collection - */ public function getLikes(): Collection { return $this->likes; diff --git a/src/CoreBundle/EventListener/TwigListener.php b/src/CoreBundle/EventListener/TwigListener.php index 9ae14fced9..52c47b6a26 100644 --- a/src/CoreBundle/EventListener/TwigListener.php +++ b/src/CoreBundle/EventListener/TwigListener.php @@ -15,7 +15,6 @@ use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Serializer\SerializerInterface; -use TicketManager; use Twig\Environment; /** @@ -62,7 +61,6 @@ class TwigListener implements EventSubscriberInterface } } - $languages = $this->languageRepository->getAllAvailable()->getQuery()->getArrayResult(); // $this->twig->addGlobal('text_direction', api_get_text_direction()); diff --git a/src/CoreBundle/EventSubscriber/AnonymousUserSubscriber.php b/src/CoreBundle/EventSubscriber/AnonymousUserSubscriber.php index 6852b66cf5..e819005cdd 100644 --- a/src/CoreBundle/EventSubscriber/AnonymousUserSubscriber.php +++ b/src/CoreBundle/EventSubscriber/AnonymousUserSubscriber.php @@ -12,7 +12,6 @@ use Chamilo\CoreBundle\Settings\SettingsManager; use DateTime; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\Security\Core\Security; @@ -25,7 +24,7 @@ class AnonymousUserSubscriber implements EventSubscriberInterface private readonly Security $security, private readonly EntityManagerInterface $entityManager, private readonly SettingsManager $settingsManager - ) { } + ) {} public function onKernelRequest(RequestEvent $event): void { diff --git a/src/CoreBundle/Framework/Container.php b/src/CoreBundle/Framework/Container.php index fb1e8c88b0..83bde50046 100644 --- a/src/CoreBundle/Framework/Container.php +++ b/src/CoreBundle/Framework/Container.php @@ -223,9 +223,6 @@ class Container return self::getLegacyHelper()->getAuthorizationChecker(); } - /** - * @return TokenStorage|TokenStorageInterface - */ public static function getTokenStorage(): TokenStorageInterface|TokenStorage { return self::getLegacyHelper()->getTokenStorage(); diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20201212195011.php b/src/CoreBundle/Migrations/Schema/V200/Version20201212195011.php index 3c07f470a3..087ba3bc2f 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20201212195011.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20201212195011.php @@ -11,8 +11,6 @@ use Chamilo\CoreBundle\Entity\AccessUrlRelCourse; use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\ExtraField; use Chamilo\CoreBundle\Entity\ResourceLink; -use Chamilo\CoreBundle\Entity\Session; -use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\AccessUrlRepository; use Chamilo\CoreBundle\Repository\Node\CourseRepository; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20201215142610.php b/src/CoreBundle/Migrations/Schema/V200/Version20201215142610.php index 590469ba0a..0889ea53c9 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20201215142610.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20201215142610.php @@ -7,7 +7,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\CourseRepository; use Chamilo\CoreBundle\Repository\Node\UserRepository; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20201215153517.php b/src/CoreBundle/Migrations/Schema/V200/Version20201215153517.php index 9784e7358a..b091b4bc0c 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20201215153517.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20201215153517.php @@ -9,7 +9,6 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\CourseRepository; -use Chamilo\CourseBundle\Entity\CAnnouncement; use Chamilo\CourseBundle\Entity\CAnnouncementAttachment; use Chamilo\CourseBundle\Entity\CQuiz; use Chamilo\CourseBundle\Repository\CAnnouncementAttachmentRepository; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20201216132000.php b/src/CoreBundle/Migrations/Schema/V200/Version20201216132000.php index 0ffe371992..60098b2fa5 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20201216132000.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20201216132000.php @@ -8,7 +8,6 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CourseBundle\Entity\CLp; -use Chamilo\CourseBundle\Entity\CLpItem; use Chamilo\CourseBundle\Repository\CLpItemRepository; use Doctrine\DBAL\Schema\Schema; use learnpath; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20201217124011.php b/src/CoreBundle/Migrations/Schema/V200/Version20201217124011.php index d0f7b14f88..e200bca9fb 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20201217124011.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20201217124011.php @@ -8,12 +8,10 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\ResourceLink; -use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\CourseRepository; use Chamilo\CoreBundle\Repository\Node\UserRepository; use Chamilo\CoreBundle\Repository\SessionRepository; -use Chamilo\CourseBundle\Entity\CGroup; use Chamilo\CourseBundle\Entity\CStudentPublication; use Chamilo\CourseBundle\Entity\CStudentPublicationComment; use Chamilo\CourseBundle\Entity\CStudentPublicationCorrection; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20210205082253.php b/src/CoreBundle/Migrations/Schema/V200/Version20210205082253.php index 9fb678d20f..9484be5011 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20210205082253.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20210205082253.php @@ -6,7 +6,6 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\AccessUrl; use Chamilo\CoreBundle\Entity\AccessUrlRelUserGroup; -use Chamilo\CoreBundle\Entity\Illustration; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\Usergroup; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20210221082033.php b/src/CoreBundle/Migrations/Schema/V200/Version20210221082033.php index bd6730fb30..5314498ead 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20210221082033.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20210221082033.php @@ -8,7 +8,6 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; -use Chamilo\CourseBundle\Entity\CLp; use Chamilo\CourseBundle\Repository\CLpRepository; use Chamilo\Kernel; use Doctrine\DBAL\Schema\Schema; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20210923090920.php b/src/CoreBundle/Migrations/Schema/V200/Version20210923090920.php index b54186ed4f..c6eda8f366 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20210923090920.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20210923090920.php @@ -7,7 +7,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Illustration; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\IllustrationRepository; use Chamilo\Kernel; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20210930130343.php b/src/CoreBundle/Migrations/Schema/V200/Version20210930130343.php index 7f4755ab22..bcb019e73c 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20210930130343.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20210930130343.php @@ -5,8 +5,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Session; -use Chamilo\CoreBundle\Entity\Tool; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\CourseRepository; use Chamilo\CoreBundle\Repository\SessionRepository; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20211005154000.php b/src/CoreBundle/Migrations/Schema/V200/Version20211005154000.php index 7dbb6076cd..333fbdc3ba 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20211005154000.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20211005154000.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\TicketMessageAttachment; -use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\TicketMessageAttachmentRepository; use Chamilo\CoreBundle\Repository\Node\UserRepository; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20230215072918.php b/src/CoreBundle/Migrations/Schema/V200/Version20230215072918.php index de09da9609..68de0bab73 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20230215072918.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20230215072918.php @@ -7,13 +7,10 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Session; -use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\CourseRepository; use Chamilo\CoreBundle\Repository\Node\UserRepository; use Chamilo\CoreBundle\Repository\SessionRepository; -use Chamilo\CourseBundle\Entity\CLp; use Chamilo\CourseBundle\Entity\CLpRelUser; use Chamilo\CourseBundle\Repository\CLpRepository; use Doctrine\DBAL\Schema\Schema; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20230216122900.php b/src/CoreBundle/Migrations/Schema/V200/Version20230216122900.php index 8dd874838f..7b791324ac 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20230216122900.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20230216122900.php @@ -8,7 +8,6 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\DataFixtures\SettingsCurrentFixtures; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; -use Chamilo\Kernel; use Doctrine\DBAL\Schema\Schema; use const JSON_UNESCAPED_SLASHES; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20230321164019.php b/src/CoreBundle/Migrations/Schema/V200/Version20230321164019.php index 26a3a55aa8..83092472ec 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20230321164019.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20230321164019.php @@ -9,7 +9,6 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\TrackEAttemptQualify; use Chamilo\CoreBundle\Entity\TrackEExercise; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; -use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\DBAL\Schema\Schema; class Version20230321164019 extends AbstractMigrationChamilo diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20230720222140.php b/src/CoreBundle/Migrations/Schema/V200/Version20230720222140.php index 3821afce3b..0ff0dba960 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20230720222140.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20230720222140.php @@ -6,7 +6,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; -use Chamilo\CoreBundle\Entity\PersonalFile; use Chamilo\CoreBundle\Entity\SocialPost; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php b/src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php index 7cf3effd60..c8896f4df7 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php @@ -8,7 +8,6 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; -use Chamilo\CourseBundle\Entity\CDocument; use Chamilo\CourseBundle\Repository\CDocumentRepository; use Doctrine\DBAL\Schema\Schema; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20231012185600.php b/src/CoreBundle/Migrations/Schema/V200/Version20231012185600.php index 2d92023a79..e89e22f303 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20231012185600.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20231012185600.php @@ -7,7 +7,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\CourseRepository; use Chamilo\CoreBundle\Repository\Node\UserRepository; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20231026231100.php b/src/CoreBundle/Migrations/Schema/V200/Version20231026231100.php index e5ebde0b7a..e04cd63dfc 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20231026231100.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20231026231100.php @@ -6,7 +6,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; -use Chamilo\CoreBundle\Entity\SocialPost; use Chamilo\CoreBundle\Entity\SocialPostAttachment; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\Node\SocialPostAttachmentRepository; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20240112103400.php b/src/CoreBundle/Migrations/Schema/V200/Version20240112103400.php index eaf4564951..4ecbf754f0 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20240112103400.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20240112103400.php @@ -7,7 +7,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\SettingsCurrent; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\SettingsCurrentRepository; use Doctrine\DBAL\Schema\Schema; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20240112191200.php b/src/CoreBundle/Migrations/Schema/V200/Version20240112191200.php index da737ebca5..a7f86669ec 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20240112191200.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20240112191200.php @@ -8,11 +8,6 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; -use Chamilo\CourseBundle\Entity\CAnnouncement; -use Chamilo\CourseBundle\Entity\CGlossary; -use Chamilo\CourseBundle\Entity\CGroupCategory; -use Chamilo\CourseBundle\Entity\CLink; -use Chamilo\CourseBundle\Entity\CLinkCategory; use Chamilo\CourseBundle\Repository\CAnnouncementRepository; use Chamilo\CourseBundle\Repository\CGlossaryRepository; use Chamilo\CourseBundle\Repository\CGroupCategoryRepository; @@ -38,7 +33,6 @@ final class Version20240112191200 extends AbstractMigrationChamilo $glossaryRepo = $this->container->get(CGlossaryRepository::class); $announcementRepo = $this->container->get(CAnnouncementRepository::class); - $this->updateResourceNodeDisplayOrder($linkCategoryRepo, 'c_link_category', $em, $schema); $this->updateResourceNodeDisplayOrder($linkRepo, 'c_link', $em, $schema); $this->updateResourceNodeDisplayOrder($groupCategoryRepo, 'c_group_category', $em, $schema); diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20240128205500.php b/src/CoreBundle/Migrations/Schema/V200/Version20240128205500.php index 3117b88d1b..d3ceb1d487 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20240128205500.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20240128205500.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; -use Chamilo\CoreBundle\Entity\GradebookCertificate; use Chamilo\CoreBundle\Entity\PersonalFile; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\GradebookCertificateRepository; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20240130161800.php b/src/CoreBundle/Migrations/Schema/V200/Version20240130161800.php index f6290ee326..e527080584 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20240130161800.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20240130161800.php @@ -7,7 +7,6 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Entity\Asset; -use Chamilo\CoreBundle\Entity\Templates; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CoreBundle\Repository\TemplatesRepository; use Doctrine\DBAL\Schema\Schema; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20240202122300.php b/src/CoreBundle/Migrations/Schema/V200/Version20240202122300.php index 6371641079..5bca86b34b 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20240202122300.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20240202122300.php @@ -8,7 +8,6 @@ namespace Chamilo\CoreBundle\Migrations\Schema\V200; use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; use Chamilo\CourseBundle\Entity\CLink; -use Chamilo\CourseBundle\Entity\CShortcut; use Chamilo\CourseBundle\Repository\CLinkRepository; use Chamilo\CourseBundle\Repository\CShortcutRepository; use Doctrine\DBAL\Schema\Schema; diff --git a/src/CoreBundle/ServiceHelper/TicketProjectHelper.php b/src/CoreBundle/ServiceHelper/TicketProjectHelper.php index 454b9f77b6..e95aba07b7 100644 --- a/src/CoreBundle/ServiceHelper/TicketProjectHelper.php +++ b/src/CoreBundle/ServiceHelper/TicketProjectHelper.php @@ -9,12 +9,14 @@ namespace Chamilo\CoreBundle\ServiceHelper; use Chamilo\CoreBundle\Settings\SettingsManager; use Symfony\Component\Security\Core\Security; +use const JSON_ERROR_NONE; + class TicketProjectHelper { public function __construct( private readonly Security $security, private readonly SettingsManager $settingsManager, - ) { } + ) {} public function userIsAllowInProject(int $projectId): bool { @@ -32,6 +34,7 @@ class TicketProjectHelper foreach ($allowRoleList as $role) { if ($this->security->isGranted($role)) { $result = true; + break; } } @@ -74,6 +77,6 @@ class TicketProjectHelper $roleIds = $data['permissions'][$projectId]; // Transform role IDs into role names using the defined mapping - return array_map(fn($roleId) => $roleMap[$roleId] ?? "$roleId", $roleIds); + return array_map(fn ($roleId) => $roleMap[$roleId] ?? "$roleId", $roleIds); } } diff --git a/src/CoreBundle/ServiceHelper/UserHelper.php b/src/CoreBundle/ServiceHelper/UserHelper.php index 1b0242d8d7..3b315dc909 100644 --- a/src/CoreBundle/ServiceHelper/UserHelper.php +++ b/src/CoreBundle/ServiceHelper/UserHelper.php @@ -14,7 +14,7 @@ class UserHelper { public function __construct( private readonly TokenStorageInterface $tokenStorage, - ) { } + ) {} public function getCurrent(): ?User {