Skip to content

Commit

Permalink
Bug fixed with PHPCollections package
Browse files Browse the repository at this point in the history
  • Loading branch information
maxalmonte14 committed Oct 3, 2018
1 parent 6207e93 commit 652e576
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Utilities/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ public function renderGamesList(?GenericList $gameCollection): void
{
$data = [];

foreach ($gameCollection as $game) {
$gameCollection->forEach(function ($game, $key) use (&$data) {
array_push($data, [
$game->gameSchedule['homeTeamAbbr'],
$game->gameSchedule['visitorTeamAbbr'],
$game->gameSchedule['site']['siteFullname'],
$game->gameSchedule['gameDate'],
sprintf('%s ET', $game->gameSchedule['gameTimeEastern']),
]);
}
});

$this->command->table(['Home','Visitor','Stadium','Date','Hour'], $data);
}
Expand All @@ -141,8 +141,8 @@ public function renderScoreBoard(?GenericList $games): void
exit($this->command->line('Sorry, there is no games right now.'));
}

foreach ($games as $game) {
$games->forEach(function ($game, $key) {
$this->printScoreBoard($game);
}
});
}
}

0 comments on commit 652e576

Please sign in to comment.