public function setNumberRepeats($numberRepeats)
    {
        if (is_int($numberRepeats) || (gettype($numberRepeats) === 'string' && Format::isVariableRef($numberRepeats))) {
            $this->numberRepeats = $numberRepeats;
        } else {
            $msg = "The numberRepeats argument must be an integer or a variable reference, '" . gettype($numberRepeats) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }