@@ 44-54 (lines=11) @@ | ||
41 | * @throws UnexpectedValue |
|
42 | * @return $this |
|
43 | */ |
|
44 | public function setParam($name, $value) |
|
45 | { |
|
46 | if (!is_string($name)) { |
|
47 | throw new UnexpectedValue(UnexpectedValue::MESSAGE_TYPE_NOT_STRING, UnexpectedValue::CODE_TYPE_NOT_STRING); |
|
48 | } |
|
49 | if (empty($name)) { |
|
50 | throw new UnexpectedValue(UnexpectedValue::MESSAGE_VALUE_EMPTY, UnexpectedValue::CODE_VALUE_EMPTY); |
|
51 | } |
|
52 | $this->params[$name] = $value; |
|
53 | return $this; |
|
54 | } |
|
55 | ||
56 | /** |
|
57 | * Get defined value for a specific key |
|
@@ 62-71 (lines=10) @@ | ||
59 | * @throws UnexpectedValue |
|
60 | * @return mixed |
|
61 | */ |
|
62 | public function getParam($name) |
|
63 | { |
|
64 | if (!is_string($name)) { |
|
65 | throw new UnexpectedValue(UnexpectedValue::MESSAGE_TYPE_NOT_STRING, UnexpectedValue::CODE_TYPE_NOT_STRING); |
|
66 | } |
|
67 | if (empty($name)) { |
|
68 | throw new UnexpectedValue(UnexpectedValue::MESSAGE_VALUE_EMPTY, UnexpectedValue::CODE_VALUE_EMPTY); |
|
69 | } |
|
70 | return isset($this->params[$name]) ? $this->params[$name] : null; |
|
71 | } |
|
72 | ||
73 | /** |
|
74 | * Return defined params |
|
@@ 114-125 (lines=12) @@ | ||
111 | * @throws UnexpectedValue |
|
112 | * @return $this |
|
113 | */ |
|
114 | public function setViewPath($viewPath) |
|
115 | { |
|
116 | if (!is_string($viewPath)) { |
|
117 | throw new UnexpectedValue(UnexpectedValue::MESSAGE_TYPE_NOT_STRING, UnexpectedValue::CODE_TYPE_NOT_STRING); |
|
118 | } |
|
119 | if (empty($viewPath)) { |
|
120 | throw new UnexpectedValue(UnexpectedValue::MESSAGE_VALUE_EMPTY, UnexpectedValue::CODE_VALUE_EMPTY); |
|
121 | } |
|
122 | ||
123 | $this->viewPath = $viewPath; |
|
124 | return $this; |
|
125 | } |
|
126 | ||
127 | /** |
|
128 | * Return defined view path |