| 1 | <?php |
||
| 7 | class Metadata implements MetadataInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | private $metadata = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param array $metadata |
||
| 16 | */ |
||
| 17 | 78 | public function __construct(array $metadata = []) |
|
| 23 | |||
| 24 | /** |
||
| 25 | * @param string $key |
||
| 26 | * @param string $value |
||
| 27 | */ |
||
| 28 | 13 | public function set($key, $value) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @param string $key |
||
| 35 | * @return mixed|null |
||
| 36 | */ |
||
| 37 | 4 | public function get($key) |
|
| 38 | { |
||
| 39 | 4 | return isset($this->metadata[$key]) ? |
|
| 40 | 4 | $this->metadata[$key] : null; |
|
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return array |
||
| 45 | */ |
||
| 46 | 30 | public function all() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * {@inheritdoc} |
||
| 53 | */ |
||
| 54 | 1 | public function getIterator() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * {@inheritdoc} |
||
| 61 | */ |
||
| 62 | 1 | public function count() |
|
| 66 | } |
||
| 67 |