From 8bd69e30d34585dbe4f9896c3348eb92e0c198a5 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Tue, 28 May 2019 10:07:40 +0200 Subject: [PATCH] Fixed reading out no result --- src/Enums/Gameresult.php | 1 + src/Game.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/Enums/Gameresult.php b/src/Enums/Gameresult.php index b5c5900..2b55a39 100644 --- a/src/Enums/Gameresult.php +++ b/src/Enums/Gameresult.php @@ -12,6 +12,7 @@ use MyCLabs\Enum\Enum; class Gameresult extends Enum { + const None = '-'; const WhiteWins = '1-0'; const Draw = '0.5-0.5'; const BlackWins = '0-1'; diff --git a/src/Game.php b/src/Game.php index 0b56cf9..7b3fe8b 100644 --- a/src/Game.php +++ b/src/Game.php @@ -35,6 +35,12 @@ class Game extends GameModel if (isset($blacksplit[1]) && $blacksplit[1] != 'Bye') { $special = ' ' . $blacksplit[1]; } + if ($whitesplit[0] == '*') { + $whitesplit[0] = ''; + } + if ($blacksplit[0] == '*') { + $blacksplit[0] = ''; + } $result = new Gameresult($whitesplit[0] . '-' . $blacksplit[0] . $special); $this->setResult($result);