Esempio n. 1
0
 public function testConstructorEmptyFirstNonEmptyIterator()
 {
     $values = array('foo' => 'bar');
     $first = new \ArrayIterator($values);
     $v = new Variadic(array($first));
     $this->assertSame($values, $v->getArrayCopy());
     $v = new Variadic(array('first' => $first));
     $this->assertSame($values, $v->getArrayCopy());
     $v = new Variadic(array('first' => $first, 'second' => 'value'));
     $this->assertSame($values, $v->getArrayCopy());
 }
Esempio n. 2
0
 /**
  * Replace the input for the current request.
  *
  * @param array|Bag $keys Array of key/value pairs or Bag object to replace bag content with
  *
  * @return $this
  */
 public function replace($keys)
 {
     $keys = new Variadic(func_get_args());
     $old = $this->copy();
     $this->exchangeArray($keys->getArrayCopy());
     return $old;
 }