public function setMaximumCount($option, $characterCount)
{
$this->dirtyCheck = true;
if (!$this->validOption($option)) {
throw new InvalidOptionException('Invalid Option');
}
if (is_null($characterCount)) {
unset($this->maximumCounts[$option]);
return $this;
}
if (!is_int($characterCount) || $characterCount < 0) {
throw new \InvalidArgumentException('Expected non-negative integer');
}
$this->maximumCounts[$option] = $characterCount;
return $this;
}