<?php
namespace FFMpegPush;
class Configuration implements ConfigurationInterface
{
private $data;
public function __construct(array $data = array())
{
$this->data = $data;
}
public function getIterator()
{
return new \ArrayIterator($this->data);
}
public function get($key, $default = null)
{
return isset($this->data[$key]) ? $this->data[$key] : $default;
}
public function set($key, $value)
{
$this->data[$key] = $value;
return $this;
}
public function has($key)
{
return array_key_exists($key, $this->data);
}
public function remove($key)
{
$value = $this->get($key);
unset($this->data[$key]);
return $value;
}
public function all()
{
return $this->data;
}
public function offsetExists($offset)
{
return $this->has($offset);
}
public function offsetGet($offset)
{
return $this->get($offset);
}
public function offsetSet($offset, $value)
{
$this->set($offset, $value);
}
public function offsetUnset($offset)
{
$this->remove($offset);
}
public static function create(array $data = array())
{
return new static($data);
}
}