Skip to content

Commit 9e722df

Browse files
committed
Minor: Format code
1 parent d3eca51 commit 9e722df

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

src/CoreBundle/Command/DeactivateUsersWithNoActiveSessionCommand.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public function __construct(
3232
protected function configure(): void
3333
{
3434
$this
35-
->addOption('dry-run', null, InputOption::VALUE_NONE, 'Run without saving changes');
35+
->addOption('dry-run', null, InputOption::VALUE_NONE, 'Run without saving changes')
36+
;
3637
}
3738

3839
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -42,15 +43,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4243
$now = new DateTime('now', new DateTimeZone('UTC'));
4344

4445
$io->title('Deactivating users without active sessions...');
45-
$io->text('Checking users as of ' . $now->format('Y-m-d H:i:s'));
46+
$io->text('Checking users as of '.$now->format('Y-m-d H:i:s'));
4647

4748
// Subquery: user IDs with at least one session where end date is in the future
4849
$subQuery = $this->entityManager->createQueryBuilder()
4950
->select('IDENTITY(sru.user)')
5051
->from('Chamilo\CoreBundle\Entity\SessionRelUser', 'sru')
5152
->join('sru.session', 's')
5253
->where('s.displayEndDate > :now')
53-
->getDQL();
54+
->getDQL()
55+
;
5456

5557
// Main query: get all active users not in the subquery
5658
$qb = $this->entityManager->createQueryBuilder();
@@ -61,11 +63,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6163
->andWhere($qb->expr()->notIn('u.id', $subQuery))
6264
->setParameter('now', $now)
6365
->getQuery()
64-
->getResult();
66+
->getResult()
67+
;
6568

6669
$deactivatedCount = 0;
6770

68-
/* @var User $user */
71+
/** @var User $user */
6972
foreach ($usersToDeactivate as $user) {
7073
$user->setActive(0);
7174
$this->entityManager->persist($user);

src/CoreBundle/Entity/User.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,9 +2484,8 @@ public function addAuthSourceByAuthentication(string $authentication, AccessUrl
24842484
public function hasAuthSourceByAuthentication(string $authentication): bool
24852485
{
24862486
return $this->authSources->exists(
2487-
fn ($key, $authSource) =>
2488-
$authSource instanceof UserAuthSource &&
2489-
$authSource->getAuthentication() === $authentication
2487+
fn ($key, $authSource) => $authSource instanceof UserAuthSource
2488+
&& $authSource->getAuthentication() === $authentication
24902489
);
24912490
}
24922491

src/CoreBundle/Form/ExtraFieldType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
106106
case \ExtraField::FIELD_TYPE_GEOLOCALIZATION_COORDINATES:
107107
case \ExtraField::FIELD_TYPE_GEOLOCALIZATION:
108108
if (!$geolocalization) {
109-
continue;
109+
break;
110110
}
111111

112112
$defaultOptions['data'] = [];

src/CourseBundle/Repository/CStudentPublicationRepository.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ public function findAssignmentSubmissionsPaginated(
290290
;
291291

292292
$qb->andWhere('submission.user = :user')
293-
->setParameter('user', $user);
293+
->setParameter('user', $user)
294+
;
294295

295296
foreach ($order as $field => $direction) {
296297
$qb->addOrderBy('submission.'.$field, $direction);
@@ -364,6 +365,7 @@ public function findAllCorrectionsByAssignment(int $assignmentId): array
364365
->setParameter('assignmentId', $assignmentId)
365366
->setParameter('filetype', 'file')
366367
->getQuery()
367-
->getResult();
368+
->getResult()
369+
;
368370
}
369371
}

0 commit comments

Comments
 (0)