More return types. Basic example

This commit is contained in:
2023-08-02 09:04:56 +00:00
parent f0aa9413e1
commit 32b8a9d83e
13 changed files with 71 additions and 33 deletions

View File

@ -10,7 +10,7 @@ abstract class Factor implements \Stringable
{
private array $messages = [];
private $messageToVariableBinding;
private HashMap $messageToVariableBinding;
private string $name;

View File

@ -4,14 +4,14 @@ namespace DNW\Skills\FactorGraphs;
class FactorGraph
{
private $variableFactory;
private VariableFactory $variableFactory;
public function getVariableFactory()
public function getVariableFactory(): VariableFactory
{
return $this->variableFactory;
}
public function setVariableFactory(VariableFactory $factory)
public function setVariableFactory(VariableFactory $factory): void
{
$this->variableFactory = $factory;
}

View File

@ -4,7 +4,7 @@ namespace DNW\Skills\FactorGraphs;
abstract class Schedule implements \Stringable
{
protected function __construct(private $_name)
protected function __construct(private string $name)
{
}
@ -12,6 +12,6 @@ abstract class Schedule implements \Stringable
public function __toString(): string
{
return (string) $this->_name;
return (string) $this->name;
}
}