CKEditorAdmin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getView() 0 9 2
1
<?php
2
/**
3
 * @copyright Copyright (c) 2018 Andrey Girnik
4
 * @author Andrey Girnik <[email protected]>
5
 * @license http://opensource.org/licenses/MIT MIT License
6
 */
7
namespace Itstructure\CKEditor;
8
9
/**
10
 * Class CKEditorAdmin
11
 * Widget class for displaying CKEditor block in admin-module view template.
12
 *
13
 * @see http://docs.ckeditor.com/
14
 *
15
 * @package Itstructure\CKEditor
16
 */
17
class CKEditorAdmin extends CKEditor
18
{
19
    /**
20
     * Give ability of configure view to the module class.
21
     *
22
     * @return \yii\base\View|\yii\web\View
23
     */
24
    public function getView()
25
    {
26
        $module = \Yii::$app->controller->module;
27
28
        if (method_exists($module, 'getView')) {
29
            return $module->getView();
30
        }
31
32
        return parent::getView();
33
    }
34
}
35