rector: codingStyle

This commit is contained in:
2024-02-21 13:48:37 +00:00
parent f3e5912ebb
commit 0184d0432b
24 changed files with 86 additions and 76 deletions

View File

@ -28,6 +28,7 @@ class TwoTeamTrueSkillCalculator extends SkillCalculator
{
parent::__construct(SkillCalculatorSupportedOptions::NONE, TeamsRange::exactly(2), PlayersRange::atLeast(1));
}
/**
* {@inheritdoc}
*/
@ -82,12 +83,12 @@ class TwoTeamTrueSkillCalculator extends SkillCalculator
$totalPlayers = $selfTeam->count() + $otherTeam->count();
$meanGetter = fn (Rating $currentRating): float => $currentRating->getMean();
$meanGetter = static fn(Rating $currentRating): float => $currentRating->getMean();
$selfMeanSum = BasicMath::sum($selfTeam->getAllRatings(), $meanGetter);
$otherTeamMeanSum = BasicMath::sum($otherTeam->getAllRatings(), $meanGetter);
$varianceGetter = fn (Rating $currentRating): float => BasicMath::square($currentRating->getStandardDeviation());
$varianceGetter = static fn(Rating $currentRating): float => BasicMath::square($currentRating->getStandardDeviation());
$c = sqrt(
BasicMath::sum($selfTeam->getAllRatings(), $varianceGetter)
@ -163,9 +164,9 @@ class TwoTeamTrueSkillCalculator extends SkillCalculator
$betaSquared = BasicMath::square($gameInfo->getBeta());
$meanGetter = fn (Rating $currentRating): float => $currentRating->getMean();
$meanGetter = static fn(Rating $currentRating): float => $currentRating->getMean();
$varianceGetter = fn (Rating $currentRating): float => BasicMath::square($currentRating->getStandardDeviation());
$varianceGetter = static fn(Rating $currentRating): float => BasicMath::square($currentRating->getStandardDeviation());
$team1MeanSum = BasicMath::sum($team1Ratings, $meanGetter);
$team1StdDevSquared = BasicMath::sum($team1Ratings, $varianceGetter);