@@ 41-51 (lines=11) @@ | ||
38 | /** |
|
39 | * Return the named option. |
|
40 | */ |
|
41 | public function getOption($name) |
|
42 | { |
|
43 | if (!isset($this->options[$name])) { |
|
44 | throw new \InvalidArgumentException(sprintf( |
|
45 | 'Unknown option "%s", known options: "%s"', |
|
46 | $name, implode('", "', array_keys($this->options)) |
|
47 | )); |
|
48 | } |
|
49 | ||
50 | return $this->options[$name]; |
|
51 | } |
|
52 | } |
|
53 |
@@ 18-28 (lines=11) @@ | ||
15 | $this->viewClosures = $viewClosures; |
|
16 | } |
|
17 | ||
18 | public function offsetGet($name) |
|
19 | { |
|
20 | if (!isset($this->viewClosures[$name])) { |
|
21 | throw new \InvalidArgumentException(sprintf( |
|
22 | 'Child view "%s" has not been set, known children: "%s"', |
|
23 | $name, implode('", "', array_keys($this->viewClosures)) |
|
24 | )); |
|
25 | } |
|
26 | ||
27 | return $this->viewClosures[$name](); |
|
28 | } |
|
29 | ||
30 | public function offsetExists($name) |
|
31 | { |