Upgrade to PHP8.4

This commit is contained in:
2025-01-28 09:18:50 +00:00
parent 2212d45f61
commit 22002891c5
10 changed files with 56 additions and 56 deletions

View File

@ -12,18 +12,18 @@ class GameInfo
/**
* Default initial mean / 6
*/
private const DEFAULT_BETA = 4.1666666666666666666666666666667;
private const float DEFAULT_BETA = 4.1666666666666666666666666666667;
private const DEFAULT_DRAW_PROBABILITY = 0.10;
private const float DEFAULT_DRAW_PROBABILITY = 0.10;
/**
* Default initial mean / 300
*/
private const DEFAULT_DYNAMICS_FACTOR = 0.083333333333333333333333333333333;
private const float DEFAULT_DYNAMICS_FACTOR = 0.083333333333333333333333333333333;
private const DEFAULT_INITIAL_MEAN = 25.0;
private const float DEFAULT_INITIAL_MEAN = 25.0;
private const DEFAULT_INITIAL_STANDARD_DEVIATION = 8.3333333333333333333333333333333;
private const float DEFAULT_INITIAL_STANDARD_DEVIATION = 8.3333333333333333333333333333333;
public function __construct(
private readonly float $initialMean = self::DEFAULT_INITIAL_MEAN,

View File

@ -12,9 +12,9 @@ namespace DNW\Skills\Numerics;
*/
class GaussianDistribution
{
private const DEFAULT_STANDARD_DEVIATION = 1.0;
private const float DEFAULT_STANDARD_DEVIATION = 1.0;
private const DEFAULT_MEAN = 0.0;
private const float DEFAULT_MEAN = 0.0;
/**
* Square Root 2π.
@ -23,7 +23,7 @@ class GaussianDistribution
*
* @link https://www.wolframalpha.com/input?i=sqrt%282*pi%29 Source of value
*/
private const M_SQRT_2_PI = 2.5066282746310005024157652848110452530069867406099383166299235763;
private const float M_SQRT_2_PI = 2.5066282746310005024157652848110452530069867406099383166299235763;
/**
* Log of Square Root 2π.
@ -32,7 +32,7 @@ class GaussianDistribution
*
* @link https://www.wolframalpha.com/input?i=log%28sqrt%282*pi%29%29 Source of value
*/
private const M_LOG_SQRT_2_PI = 0.9189385332046727417803297364056176398613974736377834128171515404;
private const float M_LOG_SQRT_2_PI = 0.9189385332046727417803297364056176398613974736377834128171515404;
// precision and precisionMean are used because they make multiplying and dividing simpler
// (see the accompanying math paper for more details)

View File

@ -9,9 +9,9 @@ namespace DNW\Skills;
*/
class Player implements ISupportPartialPlay, ISupportPartialUpdate
{
private const DEFAULT_PARTIAL_PLAY_PERCENTAGE = 1.0; // = 100% play time
private const float DEFAULT_PARTIAL_PLAY_PERCENTAGE = 1.0; // = 100% play time
private const DEFAULT_PARTIAL_UPDATE_PERCENTAGE = 1.0;
private const float DEFAULT_PARTIAL_UPDATE_PERCENTAGE = 1.0;
private readonly float $PartialPlayPct;

View File

@ -11,7 +11,7 @@ use DNW\Skills\Numerics\GaussianDistribution;
*/
class Rating
{
private const CONSERVATIVE_STANDARD_DEVIATION_MULTIPLIER = 3;
private const float CONSERVATIVE_STANDARD_DEVIATION_MULTIPLIER = 3;
/**
* Constructs a rating.

View File

@ -6,7 +6,7 @@ namespace DNW\Skills;
class Team extends RatingContainer
{
public function __construct(Player $player = NULL, Rating $rating = NULL)
public function __construct(?Player $player = NULL, ?Rating $rating = NULL)
{
parent::__construct();
if (! $player instanceof Player) {