示例#1
0
 /**
  * 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;
 }
示例#2
0
文件: Box.php 项目: ajbm6/box2-lib
 /**
  * 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;
 }