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