Skip to content

Commit

Permalink
Make code more readable.
Browse files Browse the repository at this point in the history
It is easy to mistake the `=` in an if condition as `==`, so split it
into two statements for better readability.
  • Loading branch information
meisterT committed Apr 8, 2024
1 parent c46eb28 commit 2e16f78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webapp/src/Controller/API/SubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public function addSubmissionAction(
// By default, use the user and team of the user.
$user = $this->dj->getUser();
$team = $user->getTeam();
if ($teamId = $addSubmission->teamId) {
$teamId = $addSubmission->teamId;
if ($teamId) {
$idField = $this->eventLogService->externalIdFieldForEntity(Team::class) ?? 'teamid';
$method = sprintf('get%s', ucfirst($idField));

Expand Down

0 comments on commit 2e16f78

Please sign in to comment.