Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
45 | 3 | public function getComponent() { |
|
46 | 3 | if (!empty(\yii::$app->components['sitemap'])) { |
|
47 | 1 | $component = \yii::$app->components['sitemap']; |
|
48 | 3 | } else if (!($component = $this->get('sitemap', false))) { |
|
49 | 1 | throw new Exception('Component for sitemap module is required. Define it via application components ' |
|
50 | 1 | . 'or module components'); |
|
51 | } |
||
52 | |||
53 | 2 | $component->moduleId = $this->uniqueId; |
|
54 | |||
55 | 2 | return $component; |
|
56 | } |
||
57 | } |
||
58 |