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()); }
/** * 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; }