Skip to content

Commit

Permalink
fix(output): package
Browse files Browse the repository at this point in the history
  • Loading branch information
thepercival committed Apr 29, 2024
1 parent 5bc0095 commit 576f522
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions domain/Game/Assigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(protected LoggerInterface $logger)
$this->throwOnTimeout = true;
}

public function assignGames(Planning $planning): bool
public function assignGames(Planning $planning): PlanningState
{
$games = (new PreAssignSorter())->getGames($planning);
// (new GameOutput($this->logger))->outputGames($games);
Expand All @@ -46,7 +46,7 @@ public function assignGames(Planning $planning): bool
} else {
$planning->setTimeoutState(null);
}
return false;
return $state;
}

$firstBatch = $planning->createFirstBatch();
Expand All @@ -68,13 +68,13 @@ public function assignGames(Planning $planning): bool
$planning->setTimeoutState(null);
}
$this->logger->error(' could not assign refereeplaces (plId:' . (string)$planning->getId() . ')');
return false;
return $state;
}
}
$planning->setState(PlanningState::Succeeded);
$planning->setTimeoutState(null);
$planning->setNrOfBatches($firstBatch->getLeaf()->getNumber());
return true;
return PlanningState::Succeeded;
}

public function disableThrowOnTimeout(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/PlanningCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected function createPlanning(
if ($showHighestCompletedBatchNr) {
$gameAssigner->showHighestCompletedBatchNr();
}
if( $gameAssigner->assignGames($planning) === false ) {
if( $gameAssigner->assignGames($planning) !== PlanningState::Succeeded ) {
throw new Exception("planning could not be created", E_ERROR);
}
return $planning;
Expand Down

0 comments on commit 576f522

Please sign in to comment.