add((int) $role); } } public function add(int $id): void { if ($id < 1) { throw new ManyRoleDtoException('Only Integer > 0.'); } $this->roles[] = $id; } public function toArray(): array { return $this->roles; } }