Set if the selection of items must be with or without replacements.

@param boolean $withReplacement true if it must be with replacements, false otherwise.
@throws \InvalidArgumentException If $withReplacement is not a boolean.
503924
public function setWithReplacement($withReplacement)
    {
        if (is_bool($withReplacement)) {
            $this->withReplacement = $withReplacement;
        } else {
            $msg = "WithReplacement must be a boolean, '" . gettype($withReplacement) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
256732
public void replaceWith(HasNode node) {
		feature = node.feature;
		nodeName = node.nodeName;
		trueNode = node.trueNode;
		falseNode = node.falseNode;
	}
886661
public static function replaceWith($replacement): callable
    {
        return function (&$val) use ($replacement) : bool{
            if (empty($val)) {
                $val = $replacement;
            }

            return true;
        };
    }
158083
function setApiVersion($version, $multicall = false)
    {
        if (!is_string($version)) {
            throw new InvalidArgumentException('version = ' . print_r($version, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($version), $multicall);
    }
1213918
public function replaceWith(Collection $replacement)
    {
        $this->pool = [];
        $this->map = [];
        $this->indexed = [];

        foreach ($replacement as $entity) {
            $this->addEntity($entity);
        }
    }
1265094
public function setIsOnly($isOnly)
    {
        if (is_bool($isOnly)) {
            $this->isOnly = $isOnly;

            return $this;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($isOnly). "' for argument 'isOnly' given."
            );
        }
    }
397031
protected function with($with = null, $mode = self::MODE_OR)
    {
        if ($with instanceof GenericCollection) {
            $with = $with->toArray();
        }

        if (is_array($with)) {
            return $this->andWith((array) $with, $mode);
        }

        return $with;
    }
1286544
public function HasReplacement($placeholder)
    {
        if(isset($this->translations[$this->language])) {
            $langTranslations = $this->translations[$this->language];
            return isset($langTranslations[$placeholder]);
        }
        return false;
    }
838424
public function setIsImportant($isImportant)
    {
        if (is_bool($isImportant)) {
            $this->isImportant = $isImportant;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($isImportant). "' for argument 'isImportant' given."
            );
        }
    }
628398
public function setReinforceExitEnd($reinforceExitEnd)
    {

        if (($reinforceExitEnd > 23)) {
            throw new \InvalidArgumentException('invalid value for $reinforceExitEnd when calling GetCorporationsCorporationIdCustomsOffices200Ok., must be smaller than or equal to 23.');
        }
        if (($reinforceExitEnd < 0)) {
            throw new \InvalidArgumentException('invalid value for $reinforceExitEnd when calling GetCorporationsCorporationIdCustomsOffices200Ok., must be bigger than or equal to 0.');
        }

        $this->container['reinforceExitEnd'] = $reinforceExitEnd;

        return $this;
    }
749006
public function set($key, $values, $replace = true)
    {
        if(!is_string($key) && !is_int($key)){
            throw new \InvalidArgumentException('$key expected to be string, got:'.gettype($key));
        }

        if( !is_string($values) && !is_array($values) ){
            throw new \InvalidArgumentException('$key expected to be string or array, got: '.gettype($key));
        }

        $values = array_values((array)$values);

        if (true === $replace || !isset($this->container[$key])) {
            $this->container[$key] = $values;
        } else {
            $this->container[$key] = array_merge($this->container[$key], $values);
        }
    }
1366869
public function execute(array $input)
    {
        $text = $this->textSanitizer->sanitize($input);
        $location = $this->locationSanitizer->sanitize($input);

        if (!is_callable($input['replacement'])) {
            throw new InvalidArgumentException('Invalid replacement');
        }

        $line = $text->getLine($location);
        $replacement = $input['replacement']($line);

        $text->setLine($replacement, $location);
        $text->setCurrentLineNumber($location);
    }
270507
public function setUnion(EnumSet $other): void
    {
        if ($this->enumeration !== $other->enumeration) {
            throw new InvalidArgumentException(\sprintf(
                'Other should be of the same enumeration as this %s',
                $this->enumeration
            ));
        }

        $this->bitset = $this->bitset | $other->bitset;
    }
1269090
private function splice($findName, $withName, callable $middleware, $before)
    {
        if (!isset($this->named[$findName])) {
            throw new \InvalidArgumentException("$findName not found");
        }

        $idx = $this->sorted = null;
        $step = $this->named[$findName];

        if ($withName) {
            $this->named[$withName] = $step;
        }

        foreach ($this->steps[$step] as $i => $tuple) {
            if ($tuple[1] === $findName) {
                $idx = $i;
                break;
            }
        }

        $replacement = $before
            ? [$this->steps[$step][$idx], [$middleware, $withName]]
            : [[$middleware, $withName], $this->steps[$step][$idx]];
        array_splice($this->steps[$step], $idx, 1, $replacement);
    }
1157334
public function setExistingCivilServant($existingCivilServant)
    {
        if (!is_bool($existingCivilServant)) {
            throw new \InvalidArgumentException(
                __CLASS__ . ' ' . __METHOD__ . ': Not a boolean'
            );
        }

        $this->existingCivilServant = $existingCivilServant;

        return $this;
    }
314532
public function setFixed($fixed)
    {
        if (is_bool($fixed)) {
            $this->fixed = $fixed;
        } else {
            $msg = "Fixed must be a boolean, '" . gettype($fixed) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1345005
public function setRepeat($input)
    {
        if (!is_numeric($input) || !$input) {
            throw new \InvalidArgumentException('Only positive numbers allowed.');
        }
        $this->otherOptions['repeat'] = (float)$input;

        return $this;
    }