From af3a0167e45ec136607ab3f8183019c06731a886 Mon Sep 17 00:00:00 2001 From: Daniel Guzman Date: Thu, 25 Jul 2024 01:08:32 +0200 Subject: [PATCH] Make points per draw optional --- src/Dto/SeasonDto.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Dto/SeasonDto.php b/src/Dto/SeasonDto.php index 0b9ece23..8b51c2bf 100644 --- a/src/Dto/SeasonDto.php +++ b/src/Dto/SeasonDto.php @@ -71,7 +71,7 @@ class SeasonDto { $this->pointsPerWin = (int) $dataList['pointsPerWin']; } - if (isset($dataList['pointsPerDraw'])) + if (empty($dataList['pointsPerDraw'])) { $this->pointsPerDraw = (int) $dataList['pointsPerDraw']; } @@ -206,7 +206,7 @@ class SeasonDto { $this->validationErrors[] = 'Los puntos por empate deben ser inferiores a los puntos por partido ganado.'; } - if (isset($this->pointsPerDraw, $this->pointsPerLoss) && ($this->pointsPerDraw < $this->pointsPerLoss)) + if (isset($this->pointsPerDraw, $this->pointsPerLoss) && ($this->pointsPerDraw > 0) && ($this->pointsPerDraw < $this->pointsPerLoss)) { $this->validationErrors[] = 'Los puntos por empate deben ser superiores a los puntos por partido perdido.'; }