mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 02:02:29 +01:00 
			
		
		
		
	Upgrade to PHP8.4
This commit is contained in:
		@@ -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,
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user