set() public méthode

Set and store a value under key $name to $value.
public set ( string $name, mixed $value ) : ValueHolder
$name string The key name for the value to set.
$value mixed The value to set under key $name.
Résultat ValueHolder This instance, for a fluent API.
Exemple #1
0
 /**
  * Set a single option for this command.
  *
  * @param  string $name  Name of the option to set.
  * @param  mixed  $value Value for that option.
  *
  * @return \Clinner\Command\Command This instance, for a fluent API.
  */
 public function setOption($name, $value)
 {
     $this->_options->set($name, $value);
     return $this;
 }
Exemple #2
0
 public function testSet()
 {
     $valueHolder = new ValueHolder();
     $valueHolder->set('key', 'value');
     $this->assertEquals('value', $valueHolder->key);
 }