Hackzilla\PasswordGenerator\Generator\RequirementPasswordGenerator::setMaximumCount PHP Method

setMaximumCount() public method

Set maximum count of option for desired password(s).
public setMaximumCount ( string $option, integer | null $characterCount )
$option string Use class constants
$characterCount integer | null
    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;
    }