More code standards

This commit is contained in:
2024-02-02 14:53:38 +00:00
parent 968c78d989
commit 3dddfc05db
46 changed files with 156 additions and 55 deletions

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill;
use DNW\Skills\Numerics\GaussianDistribution;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill\Factors;
use DNW\Skills\FactorGraphs\Message;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill\Layers;
use DNW\Skills\FactorGraphs\ScheduleLoop;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill\Layers;
use DNW\Skills\FactorGraphs\ScheduleStep;
@ -87,7 +89,7 @@ class PlayerPerformancesToTeamPerformancesLayer extends TrueSkillFactorGraphLaye
*/
private function createOutputVariable(array $team): Variable
{
$memberNames = array_map(fn ($currentPlayer) => (string) ($currentPlayer->getKey()), $team);
$memberNames = array_map(fn ($currentPlayer) => (string)($currentPlayer->getKey()), $team);
$teamMemberNames = \implode(', ', $memberNames);

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill\Layers;
use DNW\Skills\FactorGraphs\ScheduleStep;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill\Layers;
use DNW\Skills\FactorGraphs\KeyedVariable;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill\Layers;
use DNW\Skills\TrueSkill\DrawMargin;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill\Layers;
use DNW\Skills\FactorGraphs\Variable;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill;
use DNW\Skills\FactorGraphs\FactorGraph;
@ -60,11 +62,11 @@ class TrueSkillFactorGraph extends FactorGraph
public function buildGraph(): void
{
$lastOutput = null;
$lastOutput = NULL;
$layers = $this->layers;
foreach ($layers as $currentLayer) {
if ($lastOutput != null) {
if ($lastOutput != NULL) {
$currentLayer->setInputVariablesGroups($lastOutput);
}
@ -105,7 +107,7 @@ class TrueSkillFactorGraph extends FactorGraph
$layers = $this->layers;
foreach ($layers as $currentLayer) {
$currentPriorSchedule = $currentLayer->createPriorSchedule();
if ($currentPriorSchedule != null) {
if ($currentPriorSchedule != NULL) {
$fullSchedule[] = $currentPriorSchedule;
}
}
@ -114,7 +116,7 @@ class TrueSkillFactorGraph extends FactorGraph
foreach ($allLayersReverse as $currentLayer) {
$currentPosteriorSchedule = $currentLayer->createPosteriorSchedule();
if ($currentPosteriorSchedule != null) {
if ($currentPosteriorSchedule != NULL) {
$fullSchedule[] = $currentPosteriorSchedule;
}
}

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill;
use DNW\Skills\Numerics\GaussianDistribution;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill;
use DNW\Skills\GameInfo;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace DNW\Skills\TrueSkill;
use DNW\Skills\GameInfo;