public function setLength($characterCount) { if (!is_int($characterCount) || $characterCount < 1) { throw new \InvalidArgumentException('Expected positive integer'); } $this->setOptionValue(self::OPTION_LENGTH, $characterCount); return $this; }