/** * Sets the list of server variables to modify. * * @param array $list The list. * * @return StubGenerator The stub generator. * * @throws Exception\Exception * @throws InvalidArgumentException If the list contains an invalid value. */ public function mung(array $list) { foreach ($list as $value) { if (false === in_array($value, self::$allowedMung)) { throw InvalidArgumentException::create('The $_SERVER variable "%s" is not allowed.', $value); } } $this->mung = $list; return $this; }
/** * Sets the placeholder values. * * @param array $values The values. * * @throws Exception\Exception * @throws InvalidArgumentException If a non-scalar value is used. */ public function setValues(array $values) { foreach ($values as $value) { if (false === is_scalar($value)) { throw InvalidArgumentException::create('Non-scalar values (such as %s) are not supported.', gettype($value)); } } $this->values = $values; }