Skip to content

Commit 6749c8a

Browse files
committed
Minor: Format code
1 parent 1833b86 commit 6749c8a

File tree

12 files changed

+42
-43
lines changed

12 files changed

+42
-43
lines changed

src/CoreBundle/Command/AzureSyncAbstractCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ abstract class AzureSyncAbstractCommand extends Command
3636
public function __construct(
3737
protected readonly ClientRegistry $clientRegistry,
3838
AuthenticationConfigHelper $configHelper,
39-
readonly protected AzureAuthenticatorHelper $azureHelper,
40-
readonly protected AzureSyncStateRepository $syncStateRepo,
39+
protected readonly AzureAuthenticatorHelper $azureHelper,
40+
protected readonly AzureSyncStateRepository $syncStateRepo,
4141
protected readonly EntityManagerInterface $entityManager,
4242
protected readonly UserRepository $userRepository,
4343
protected readonly UsergroupRepository $usergroupRepository,

src/CoreBundle/Controller/Api/UserAccessUrlsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ public function __invoke(User $user): array
2222
{
2323
return $this->accessUrlRepo->getUserActivePortals($user)->getQuery()->getResult();
2424
}
25-
}
25+
}

src/CoreBundle/Controller/CertificateController.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ public function view(string $hash): Response
4040
$matchedPath = '';
4141
foreach ($candidates as $cand) {
4242
$row = $this->certificateRepository->findOneBy(['pathCertificate' => $cand]);
43-
if ($row) { $certificate = $row; $matchedPath = $cand; break; }
43+
if ($row) {
44+
$certificate = $row;
45+
$matchedPath = $cand;
46+
47+
break;
48+
}
4449
}
4550
if (!$certificate) {
4651
throw new NotFoundHttpException('The requested certificate does not exist.');
@@ -68,7 +73,12 @@ public function view(string $hash): Response
6873
$pfMatch = '';
6974
foreach ($candidates as $cand) {
7075
$row = $personalFileRepo->findOneBy(['title' => $cand]);
71-
if ($row) { $pf = $row; $pfMatch = $cand; break; }
76+
if ($row) {
77+
$pf = $row;
78+
$pfMatch = $cand;
79+
80+
break;
81+
}
7282
}
7383
if (!$pf) {
7484
throw new NotFoundHttpException('The certificate file was not found.');
@@ -93,7 +103,12 @@ public function downloadPdf(string $hash): Response
93103
$matchedPath = '';
94104
foreach ($candidates as $cand) {
95105
$row = $this->certificateRepository->findOneBy(['pathCertificate' => $cand]);
96-
if ($row) { $certificate = $row; $matchedPath = $cand; break; }
106+
if ($row) {
107+
$certificate = $row;
108+
$matchedPath = $cand;
109+
110+
break;
111+
}
97112
}
98113
if (!$certificate) {
99114
throw $this->createNotFoundException('The requested certificate does not exist.');
@@ -119,7 +134,12 @@ public function downloadPdf(string $hash): Response
119134
$pfMatch = '';
120135
foreach ($candidates as $cand) {
121136
$row = $personalFileRepo->findOneBy(['title' => $cand]);
122-
if ($row) { $pf = $row; $pfMatch = $cand; break; }
137+
if ($row) {
138+
$pf = $row;
139+
$pfMatch = $cand;
140+
141+
break;
142+
}
123143
}
124144
if (!$pf) {
125145
throw $this->createNotFoundException('The certificate file was not found.');

src/CoreBundle/Controller/SecurityController.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
namespace Chamilo\CoreBundle\Controller;
88

9-
use Chamilo\CoreBundle\Entity\AccessUrl;
10-
use Chamilo\CoreBundle\Entity\AccessUrlRelUser;
119
use Chamilo\CoreBundle\Entity\Course;
1210
use Chamilo\CoreBundle\Entity\ExtraFieldValues;
1311
use Chamilo\CoreBundle\Entity\Legal;
@@ -35,8 +33,6 @@
3533
use Symfony\Component\Routing\RouterInterface;
3634
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
3735
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
38-
use Symfony\Component\Security\Core\User\UserProviderInterface;
39-
use Symfony\Component\Security\Http\Authentication\UserAuthenticatorInterface;
4036
use Symfony\Component\Serializer\SerializerInterface;
4137
use Symfony\Contracts\Translation\TranslatorInterface;
4238

src/CoreBundle/Entity/AccessUrl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,14 +616,14 @@ public function setIsLoginOnly(bool $isLoginOnly): static
616616
return $this;
617617
}
618618

619-
public function setSuperior(?AccessUrl $accessUrl): static
619+
public function setSuperior(?self $accessUrl): static
620620
{
621621
$this->parent = $accessUrl;
622622

623623
return $this;
624624
}
625625

626-
public function getSuperior(): ?AccessUrl
626+
public function getSuperior(): ?self
627627
{
628628
return $this->parent;
629629
}

src/CoreBundle/Entity/Listener/AccessUrlListener.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
use Chamilo\CoreBundle\Entity\AccessUrl;
1010
use Chamilo\CoreBundle\Helpers\AccessUrlHelper;
1111
use Chamilo\CoreBundle\Repository\Node\AccessUrlRepository;
12-
use Doctrine\ORM\Event\PostFlushEventArgs;
1312
use Doctrine\ORM\Event\PostPersistEventArgs;
14-
use Doctrine\ORM\Event\PostUpdateEventArgs;
1513
use Doctrine\ORM\Event\PrePersistEventArgs;
16-
use Doctrine\Persistence\ObjectManager;
1714

1815
readonly class AccessUrlListener
1916
{
@@ -64,7 +61,7 @@ public function postPersist(AccessUrl $currentAccessUrl, PostPersistEventArgs $a
6461
$firstAccessUrl = $this->accessUrlHelper->getFirstAccessUrl();
6562

6663
foreach ($all as $accessUrl) {
67-
if (in_array($accessUrl->getId(), [$firstAccessUrl->getId(), $currentAccessUrl->getId()])) {
64+
if (\in_array($accessUrl->getId(), [$firstAccessUrl->getId(), $currentAccessUrl->getId()])) {
6865
continue;
6966
}
7067

@@ -76,4 +73,4 @@ public function postPersist(AccessUrl $currentAccessUrl, PostPersistEventArgs $a
7673

7774
$args->getObjectManager()->flush();
7875
}
79-
}
76+
}

src/CoreBundle/EventListener/TwigListener.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Chamilo\CoreBundle\Helpers\AccessUrlHelper;
1010
use Chamilo\CoreBundle\Helpers\UserHelper;
1111
use Chamilo\CoreBundle\Repository\LanguageRepository;
12-
use Chamilo\CoreBundle\Repository\Node\AccessUrlRepository;
1312
use Symfony\Component\HttpKernel\Event\ControllerEvent;
1413
use Symfony\Component\Serializer\SerializerInterface;
1514
use Twig\Environment;

src/CoreBundle/Helpers/AccessUrlHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
use Chamilo\CoreBundle\Framework\Container;
1111
use Chamilo\CoreBundle\Repository\Node\AccessUrlRepository;
1212
use Pdp\Rules;
13-
use Pdp\TopLevelDomains;
1413
use Symfony\Component\HttpFoundation\RequestStack;
1514

1615
use const PHP_SAPI;
16+
use const PHP_URL_HOST;
1717

1818
readonly class AccessUrlHelper
1919
{

src/CoreBundle/Migrations/Schema/V200/Version20201212195112.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use Chamilo\CoreBundle\Entity\Course;
1010
use Chamilo\CoreBundle\Entity\ResourceLink;
11-
use Chamilo\CoreBundle\Entity\Session;
1211
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
1312
use Chamilo\CoreBundle\Repository\Node\CourseRepository;
1413
use Chamilo\CoreBundle\Repository\SessionRepository;

src/CoreBundle/Repository/GradebookCertificateRepository.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,19 @@ public function registerUserInfoAboutCertificate(int $catId, int $userId, float
7575
$certificate = new GradebookCertificate();
7676

7777
$category = 0 === $catId ? null : $this->_em->getRepository(GradebookCategory::class)->find($catId);
78-
$user = $this->_em->getRepository(User::class)->find($userId);
78+
$user = $this->_em->getRepository(User::class)->find($userId);
7979

8080
if ($category) {
8181
$certificate->setCategory($category);
8282
}
8383
$certificate->setUser($user);
8484
$certificate->setPathCertificate($fileName);
8585
$certificate->setScoreCertificate($scoreCertificate);
86-
$certificate->setCreatedAt(new \DateTime());
86+
$certificate->setCreatedAt(new DateTime());
8787

8888
$this->_em->persist($certificate);
8989
$this->_em->flush();
90+
9091
return;
9192
}
9293

0 commit comments

Comments
 (0)