From 93df0e8ffdc1fcb1fa1fc31dd06247136f3e5384 Mon Sep 17 00:00:00 2001 From: Daniel Guzman Date: Sun, 26 May 2024 12:33:13 +0200 Subject: [PATCH] improve validation --- src/Dto/LeagueDto.php | 6 +++--- var/cache/dev/url_matching_routes.php.meta | Bin 2861 -> 2861 bytes 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Dto/LeagueDto.php b/src/Dto/LeagueDto.php index 72d48633..f1f659b2 100644 --- a/src/Dto/LeagueDto.php +++ b/src/Dto/LeagueDto.php @@ -200,15 +200,15 @@ class LeagueDto { $this->validationErrors[] = 'Los puntos por partido ganado deben ser superiores a los puntos por empate y por perdida.'; } - if (($this->pointsPerDraw > $this->pointsPerWin)) + if (isset($this->pointsPerDraw, $this->pointsPerWin) && ($this->pointsPerDraw > $this->pointsPerWin)) { $this->validationErrors[] = 'Los puntos por empate deben ser inferiores a los puntos por partido ganado.'; } - if (($this->pointsPerDraw < $this->pointsPerLoss)) + if (isset($this->pointsPerDraw, $this->pointsPerLoss) && ($this->pointsPerDraw < $this->pointsPerLoss)) { $this->validationErrors[] = 'Los puntos por empate deben ser superiores a los puntos por partido perdido.'; } - if ($this->pointsPerWin + $this->pointsPerDraw + $this->pointsPerLoss > 20) + if (isset($this->pointsPerDraw, $this->pointsPerWin, $this->pointsPerLoss) && ($this->pointsPerWin + $this->pointsPerDraw + $this->pointsPerLoss > 20)) { $this->validationErrors[] = 'La suma de los puntos por partidos ganados, perdidos y empatados no puede ser superior a 20.'; } diff --git a/var/cache/dev/url_matching_routes.php.meta b/var/cache/dev/url_matching_routes.php.meta index 3574910bda2912fcfccc26fe38a53bed0f7f7c4c..168b169ad06ff57273954a1d1542daf0837b4a5b 100644 GIT binary patch delta 13 UcmZ20wpMJzKQ6|y$^W_Z04Qz+fB*mh delta 13 UcmZ20wpMJzKQ6}j$^W_Z04MteX#fBK