count_characters($string) > $length) { return TRUE; } return FALSE; } public function setName(string $name): Self { if ($this->longerThan($name, 32)) { throw new InvalidArgumentException("Name is too long!"); } $this->name = $name; return $this; } public function setCompany(string $company): Self { if ($this->longerThan($company, 32)) { throw new InvalidArgumentException("Company is too long!"); } $this->company = $company; return $this; } public function setCardnumber(string $cardnumber): Self { if ($this->longerThan($cardnumber, 32)) { throw new InvalidArgumentException("Cardnumber is too long!"); } $this->cardnumber = $cardnumber; return $this; } public function setLeader(string $leader): Self { if ($this->longerThan($leader, 32)) { throw new InvalidArgumentException("Leader is too long!"); } $this->leader = $leader; return $this; } public function setPhone(int $phone): Self { if ($this->longerThan((string)$phone, 32)) { throw new InvalidArgumentException("Phone number is too long!"); } $this->phone = $phone; return $this; } public function setParticipants(int $participants): Self { if ($this->longerThan((string)$participants, 32)) { throw new InvalidArgumentException("Participants is too long!"); } $this->participants = $participants; return $this; } public function setRounds(int $rounds): Self { if ($this->longerThan((string)$rounds, 32)) { throw new InvalidArgumentException("Rounds is too long!"); } $this->rounds = $rounds; return $this; } }