Nwidart\Modules\Json::set PHP Method

set() public method

Set a specific key & value.
public set ( string $key, mixed $value )
$key string
$value mixed
    public function set($key, $value)
    {
        $this->attributes->offsetSet($key, $value);
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 /** @test */
 public function it_sets_a_key_value()
 {
     $this->json->set('key', 'value');
     $this->assertEquals('value', $this->json->get('key'));
 }