Steverobbins_Slack_Model_Config_Settings   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1
Metric Value
wmc 8
lcom 1
cbo 1
dl 0
loc 82
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isActive() 0 4 1
A isDebug() 0 4 1
A getApiUrl() 0 4 1
A getToken() 0 4 1
A getBotName() 0 4 1
A getChannels() 0 4 1
A setChannels() 0 4 1
1
<?php
2
/**
3
 * Slack.com Integration
4
 *
5
 * PHP Version 5
6
 *
7
 * @category  Steverobbins
8
 * @package   Steverobbins_Slack
9
 * @author    Steve Robbins <[email protected]>
10
 * @copyright Copyright 2015 Steve Robbins (http://steverobbins.com)
11
 * @license   http://creativecommons.org/licenses/by/3.0/deed.en_US Creative Commons Attribution 3.0 Unported License
12
 */
13
14
/**
15
 * Abstract config getter
16
 */
17
class Steverobbins_Slack_Model_Config_Settings extends Steverobbins_Slack_Model_Config_Abstract
18
{
19
    /**
20
     * Set the config group
21
     */
22
    public function __construct()
23
    {
24
        $this->setGroup('settings');
25
    }
26
27
    /**
28
     * Determines if the module is active
29
     *
30
     * @return boolean
31
     */
32
    public function isActive()
33
    {
34
        return $this->getConfigFlag('active');
35
    }
36
37
    /**
38
     * Determines if the debug mode is one
39
     *
40
     * @return boolean
41
     */
42
    public function isDebug()
43
    {
44
        return $this->getConfigFlag('debug');
45
    }
46
47
    /**
48
     * Gets the API url
49
     *
50
     * @return string
51
     */
52
    public function getApiUrl()
53
    {
54
        return $this->getConfig('api_url');
55
    }
56
57
    /**
58
     * Gets the API token
59
     *
60
     * @return string
61
     */
62
    public function getToken()
63
    {
64
        return $this->getConfig('token');
65
    }
66
67
    /**
68
     * Gets bot name
69
     *
70
     * @return string
71
     */
72
    public function getBotName()
73
    {
74
        return $this->getConfig('bot_name');
75
    }
76
77
    /**
78
     * Gets channels by identifier and name
79
     *
80
     * @return array
81
     */
82
    public function getChannels()
83
    {
84
        return $this->getConfig('channels');
85
    }
86
87
    /**
88
     * Gets channels by identifier and name
89
     *
90
     * @param array $channels
91
     *
92
     * @return array
93
     */
94
    public function setChannels(array $channels)
95
    {
96
        return $this->setConfig('channels', $channels);
97
    }
98
}
99