예제 #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());
 }
예제 #2
0
파일: Bag.php 프로젝트: pinepain/jetbag
 /**
  * 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;
 }