@@ 202-215 (lines=14) @@ | ||
199 | * |
|
200 | * @return string Component class name. |
|
201 | */ |
|
202 | private function getComponentClass($componentName) |
|
203 | { |
|
204 | $componentClassKey = self::COMPONENT_CLASS_CONFIG_KEY; |
|
205 | if (isset($this->config[$componentName][$componentClassKey]) === false || |
|
206 | is_string($this->config[$componentName][$componentClassKey]) === false |
|
207 | ) { |
|
208 | $errorMessage = sprintf('Invalid class configuration of component «%s».', $componentName); |
|
209 | throw new Exception($errorMessage); |
|
210 | } |
|
211 | ||
212 | $componentClass = $this->config[$componentName][$componentClassKey]; |
|
213 | ||
214 | return $componentClass; |
|
215 | } |
|
216 | ||
217 | /** |
|
218 | * Returns component configuration parameters. |
|
@@ 224-239 (lines=16) @@ | ||
221 | * |
|
222 | * @return array Component configuration parameters. |
|
223 | */ |
|
224 | private function getComponentConfiguration($componentName) |
|
225 | { |
|
226 | $componentConfig = array(); |
|
227 | ||
228 | $componentConfigKey = self::COMPONENT_CONFIG_CONFIG_KEY; |
|
229 | if (isset($this->config[$componentName][$componentConfigKey]) === true) { |
|
230 | if (is_array($this->config[$componentName][$componentConfigKey]) === true) { |
|
231 | $componentConfig = $this->config[$componentName][$componentConfigKey]; |
|
232 | } else { |
|
233 | $errorMessage = sprintf('Invalid configuration of component «%s».', $componentName); |
|
234 | throw new Exception($errorMessage); |
|
235 | } |
|
236 | } |
|
237 | ||
238 | return $componentConfig; |
|
239 | } |
|
240 | } |
|
241 |