From 83a647cc26b29045ca92389c2bfd5144d4f694bf Mon Sep 17 00:00:00 2001 From: William Date: Thu, 10 Mar 2022 09:38:39 +0100 Subject: [PATCH] Commit --- app/lib/App/Teamtable/Team.php | 6 +++--- public/teamtable/edit/update.php | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/lib/App/Teamtable/Team.php b/app/lib/App/Teamtable/Team.php index 6934017..0707aec 100644 --- a/app/lib/App/Teamtable/Team.php +++ b/app/lib/App/Teamtable/Team.php @@ -80,7 +80,7 @@ class Team public function setPhone(int $phone): Self { - if ($this->longerThan($phone, 32)) + if ($this->longerThan((string)$phone, 32)) { throw new InvalidArgumentException("Phone number is too long!"); } @@ -90,7 +90,7 @@ class Team public function setParticipants(int $participants): Self { - if ($this->longerThan($participants, 32)) + if ($this->longerThan((string)$participants, 32)) { throw new InvalidArgumentException("Participants is too long!"); } @@ -100,7 +100,7 @@ class Team public function setRounds(int $rounds): Self { - if ($this->longerThan($rounds, 32)) + if ($this->longerThan((string)$rounds, 32)) { throw new InvalidArgumentException("Rounds is too long!"); } diff --git a/public/teamtable/edit/update.php b/public/teamtable/edit/update.php index 9ec8b86..db7c8b6 100644 --- a/public/teamtable/edit/update.php +++ b/public/teamtable/edit/update.php @@ -9,6 +9,7 @@ $item = filter_input(INPUT_GET, 'item', FILTER_VALIDATE_INT); $model = $app->model('Teamtable'); +$team; if ($item !== NULL) { $team = $model->get($item); @@ -61,8 +62,6 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') if ($item !== NULL) { // team exists - $team = $model->get($item); - $title = "Endre lag"; $app->view('template/header', [ 'title' => $title