1 | <?php |
||
17 | class MarkupCollection implements \ArrayAccess |
||
18 | { |
||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $collection = []; |
||
23 | |||
24 | /** |
||
25 | * @param array $markups |
||
26 | */ |
||
27 | public function __construct(array $markups = []) |
||
34 | |||
35 | /** |
||
36 | * Whether a markup exists. |
||
37 | * |
||
38 | * @param string $name Markup name. |
||
39 | * |
||
40 | * @return boolean `true` if the markup exists, `false` otherwise. |
||
41 | */ |
||
42 | public function offsetExists($name) |
||
46 | |||
47 | /** |
||
48 | * Returns a markup definition. |
||
49 | * |
||
50 | * @param string $name Markup name. |
||
51 | * |
||
52 | * @return array The markup's definition. |
||
53 | * |
||
54 | * @throws MarkupNotDefined when the markup is not defined. |
||
55 | */ |
||
56 | public function offsetGet($name) |
||
65 | |||
66 | /** |
||
67 | * Sets a markup definition. |
||
68 | * |
||
69 | * @param string $name Markup name. |
||
70 | * @param array $definition Markup definition. |
||
71 | */ |
||
72 | public function offsetSet($name, $definition) |
||
76 | |||
77 | /** |
||
78 | * Removes a markup. |
||
79 | * |
||
80 | * @param string $name Markup name. |
||
81 | */ |
||
82 | public function offsetUnset($name) |
||
86 | } |
||
87 |