@@ 174-187 (lines=14) @@ | ||
171 | * |
|
172 | * @return string Component class name. |
|
173 | */ |
|
174 | private function getComponentClass($componentName) |
|
175 | { |
|
176 | $componentClassKey = self::COMPONENT_CLASS_CONFIG_KEY; |
|
177 | if (isset($this->config[$componentName][$componentClassKey]) === false || |
|
178 | is_string($this->config[$componentName][$componentClassKey]) === false |
|
179 | ) { |
|
180 | $errorMessage = sprintf('Invalid class configuration of component «%s».', $componentName); |
|
181 | throw new Exception($errorMessage); |
|
182 | } |
|
183 | ||
184 | $componentClass = $this->config[$componentName][$componentClassKey]; |
|
185 | ||
186 | return $componentClass; |
|
187 | } |
|
188 | ||
189 | /** |
|
190 | * Returns component configuration parameters. |
|
@@ 196-211 (lines=16) @@ | ||
193 | * |
|
194 | * @return string Component configuration parameters. |
|
195 | */ |
|
196 | private function getComponentConfiguration($componentName) |
|
197 | { |
|
198 | $componentConfig = array(); |
|
199 | ||
200 | $componentConfigKey = self::COMPONENT_CONFIG_CONFIG_KEY; |
|
201 | if (isset($this->config[$componentName][$componentConfigKey]) === true) { |
|
202 | if (is_array($this->config[$componentName][$componentConfigKey]) === true) { |
|
203 | $componentConfig = $this->config[$componentName][$componentConfigKey]; |
|
204 | } else { |
|
205 | $errorMessage = sprintf('Invalid configuration of component «%s».', $componentName); |
|
206 | throw new Exception($errorMessage); |
|
207 | } |
|
208 | } |
|
209 | ||
210 | return $componentConfig; |
|
211 | } |
|
212 | } |
|
213 |