From 2e16f7831b33c826ea4c56421a623f3d9dc1b156 Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Tue, 9 Apr 2024 00:01:36 +0200 Subject: [PATCH] Make code more readable. It is easy to mistake the `=` in an if condition as `==`, so split it into two statements for better readability. --- webapp/src/Controller/API/SubmissionController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/src/Controller/API/SubmissionController.php b/webapp/src/Controller/API/SubmissionController.php index 1d7564056f..6a74918ea3 100644 --- a/webapp/src/Controller/API/SubmissionController.php +++ b/webapp/src/Controller/API/SubmissionController.php @@ -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));