GeneralController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 44
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A actionIndex() 0 15 1
A getBaseActionPath() 0 4 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/hubspot/license
6
 * @link       https://www.flipboxfactory.com/software/hubspot/
7
 */
8
9
namespace flipbox\craft\hubspot\cp\controllers\settings\view;
10
11
use flipbox\craft\hubspot\records\Connection;
12
use flipbox\craft\hubspot\web\assets\base\Base;
13
use yii\web\Response;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 1.0.0
18
 */
19
class GeneralController extends AbstractController
20
{
21
    /**
22
     * The template base path
23
     */
24
    const TEMPLATE_BASE = parent::TEMPLATE_BASE . '/general';
25
26
    /**
27
     * The index view template path
28
     */
29
    const TEMPLATE_INDEX = self::TEMPLATE_BASE . '/index';
30
31
    /**
32
     * @return Response
33
     * @throws \yii\base\InvalidConfigException
34
     */
35
    public function actionIndex(): Response
36
    {
37
        $variables = [];
38
        $this->baseVariables($variables);
39
40
        $this->view->registerAssetBundle(Base::class);
41
42
        $variables['connections'] = Connection::find()->all();
43
        $variables['fullPageForm'] = true;
44
45
        return $this->renderTemplate(
46
            static::TEMPLATE_INDEX,
47
            $variables
48
        );
49
    }
50
51
    /*******************************************
52
     * BASE PATHS
53
     *******************************************/
54
55
    /**
56
     * @return string
57
     */
58
    protected function getBaseActionPath(): string
59
    {
60
        return parent::getBaseActionPath() . '/general';
61
    }
62
}
63