mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-19 20:34:28 +00:00
More type checks
This commit is contained in:
@ -2,7 +2,6 @@
|
||||
|
||||
namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
// edit this
|
||||
abstract class FactorGraphLayer
|
||||
{
|
||||
private array $_localFactors = [];
|
||||
@ -47,7 +46,7 @@ abstract class FactorGraphLayer
|
||||
$this->_inputVariablesGroups = $value;
|
||||
}
|
||||
|
||||
protected function scheduleSequence(array $itemsToSequence, $name)
|
||||
protected function scheduleSequence(array $itemsToSequence, $name): ScheduleSequence
|
||||
{
|
||||
return new ScheduleSequence($name, $itemsToSequence);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ abstract class Schedule implements \Stringable
|
||||
{
|
||||
}
|
||||
|
||||
abstract public function visit($depth = -1, $maxDepth = 0);
|
||||
abstract public function visit(int $depth = -1, int $maxDepth = 0);
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ class ScheduleLoop extends Schedule
|
||||
parent::__construct($name);
|
||||
}
|
||||
|
||||
public function visit($depth = -1, $maxDepth = 0)
|
||||
public function visit(int $depth = -1, int $maxDepth = 0)
|
||||
{
|
||||
$totalIterations = 1;
|
||||
$delta = $this->_scheduleToLoop->visit($depth + 1, $maxDepth);
|
||||
|
@ -4,22 +4,22 @@ namespace DNW\Skills\FactorGraphs;
|
||||
|
||||
class Variable implements \Stringable
|
||||
{
|
||||
private $_name;
|
||||
private string $_name;
|
||||
|
||||
private $_value;
|
||||
private mixed $_value;
|
||||
|
||||
public function __construct($name, private $_prior)
|
||||
public function __construct(string $name, private mixed $_prior)
|
||||
{
|
||||
$this->_name = 'Variable['.$name.']';
|
||||
$this->resetToPrior();
|
||||
}
|
||||
|
||||
public function getValue()
|
||||
public function getValue(): mixed
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
public function setValue($value)
|
||||
public function setValue(mixed $value): void
|
||||
{
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user