Skip to content

Commit

Permalink
Always use the null coalescent operator in servicesession
Browse files Browse the repository at this point in the history
To make sure no warning is emitted
  • Loading branch information
n-peugnet authored and vincent-peugnet committed May 5, 2024
1 parent 5333c18 commit 00c1ae3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/class/Servicesession.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function setvisitor(bool $visitor): void

public function getvisitor(): bool
{
return $_SESSION['visitor'];
return $_SESSION['visitor'] ?? true;
}

public function setuser(string $userid): void
Expand All @@ -21,7 +21,7 @@ public function setuser(string $userid): void

public function getuser(): ?string
{
return $_SESSION['user'];
return $_SESSION['user'] ?? null;
}

public function setwsessionid(string $wsessionid): void
Expand Down

0 comments on commit 00c1ae3

Please sign in to comment.