mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-19 20:34:28 +00:00
Rector standards slowly being applied. PHP Version first.
This commit is contained in:
@ -15,9 +15,9 @@ abstract class Factor implements \Stringable
|
||||
*/
|
||||
private array $messages = [];
|
||||
|
||||
private HashMap $messageToVariableBinding;
|
||||
private readonly HashMap $messageToVariableBinding;
|
||||
|
||||
private string $name;
|
||||
private readonly string $name;
|
||||
|
||||
/**
|
||||
* @var Variable[] $variables
|
||||
|
@ -6,7 +6,7 @@ namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
class KeyedVariable extends Variable
|
||||
{
|
||||
public function __construct(private mixed $key, string $name, mixed $prior)
|
||||
public function __construct(private readonly mixed $key, string $name, mixed $prior)
|
||||
{
|
||||
parent::__construct($name, $prior);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use DNW\Skills\Numerics\GaussianDistribution;
|
||||
|
||||
class Message implements \Stringable
|
||||
{
|
||||
public function __construct(private GaussianDistribution $value, private string $name)
|
||||
public function __construct(private GaussianDistribution $value, private readonly string $name)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
abstract class Schedule implements \Stringable
|
||||
{
|
||||
protected function __construct(private string $name)
|
||||
protected function __construct(private readonly string $name)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
class ScheduleLoop extends Schedule
|
||||
{
|
||||
public function __construct(string $name, private readonly Schedule $scheduleToLoop, private float $maxDelta)
|
||||
public function __construct(string $name, private readonly Schedule $scheduleToLoop, private readonly float $maxDelta)
|
||||
{
|
||||
parent::__construct($name);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
class ScheduleStep extends Schedule
|
||||
{
|
||||
public function __construct(string $name, private readonly Factor $factor, private int $index)
|
||||
public function __construct(string $name, private readonly Factor $factor, private readonly int $index)
|
||||
{
|
||||
parent::__construct($name);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use DNW\Skills\Numerics\GaussianDistribution;
|
||||
|
||||
class Variable implements \Stringable
|
||||
{
|
||||
private string $name;
|
||||
private readonly string $name;
|
||||
|
||||
private mixed $value;
|
||||
|
||||
|
Reference in New Issue
Block a user