Skip to content

Commit

Permalink
Add missing nullable marker and use null coalescing assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Feb 14, 2025
1 parent b2bedd6 commit 6a8d0dc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/Transformers/UserStatisticsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ class UserStatisticsTransformer extends TransformerAbstract
'variants',
];

public function transform(UserStatistics\Model $stats = null)
public function transform(?UserStatistics\Model $stats = null)
{
if ($stats === null) {
$stats = new UserStatistics\Osu();
}
$stats ??= new UserStatistics\Osu();

if (!$GLOBALS['cfg']['osu']['scores']['experimental_rank_as_default'] && $GLOBALS['cfg']['osu']['scores']['experimental_rank_as_extra']) {
$globalRankExp = $stats->globalRankExp();
Expand Down

0 comments on commit 6a8d0dc

Please sign in to comment.