create() public static method

$initial might either be an array or another instance of ValueHolder, in which case it will be returned as is.
public static create ( array | ValueHolder $initial = [] ) : ValueHolder
$initial array | ValueHolder (Optional) initial set of values.
return ValueHolder
Example #1
0
 public function testStaticCreateWithInitialValuesValueHolder()
 {
     $initialValues = array('key' => 'value');
     $sourceValueHolder = new ValueHolder($initialValues);
     $valueHolder = ValueHolder::create($sourceValueHolder);
     $this->assertSame($sourceValueHolder, $valueHolder);
 }
Example #2
0
 /**
  * Set this command's options as a whole.
  * $options might either be an array or a ValueHolder.
  *
  * @see    \Clinner\ValueHolder::create()
  *
  * @param  \Clinner\ValueHolder|array $options The options for this command.
  *
  * @return \Clinner\Command\Command This instance, for a fluent API.
  */
 public function setOptions($options)
 {
     $this->_options = ValueHolder::create($options);
     return $this;
 }