Rector standards slowly being applied. PHP Version first.

This commit is contained in:
2024-02-20 14:21:44 +00:00
parent c72112c5aa
commit 660fbd1486
25 changed files with 108 additions and 36 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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)
{
}

View File

@ -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)
{
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -8,7 +8,7 @@ use DNW\Skills\Numerics\GaussianDistribution;
class Variable implements \Stringable
{
private string $name;
private readonly string $name;
private mixed $value;