Completed
Push — master ( 2cdd56...cec501 )
by Brian
08:59
created

Module   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 82
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 4 1
A getName() 0 4 1
A getStatus() 0 4 1
A getType() 0 4 1
A getUseCount() 0 4 1
A __construct() 0 10 1
1
<?php
2
3
/*
4
 * Copyright 2017 Brian Smith <[email protected]>.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *      http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace phparia\Resources;
20
21
/**
22
 * Details of an Asterisk module
23
 *
24
 * @author Eric Smith <[email protected]>
25
 */
26
class Module extends Response
27
{
28
    /**
29
     * @var string The description of this module
30
     */
31
    private $description;
32
33
    /**
34
     * @var string The name of this module
35
     */
36
    private $name;
37
38
    /**
39
     * @var string The running status of this module
40
     */
41
    private $status;
42
43
    /**
44
     * @var string The support state of this module
45
     */
46
    private $supportLevel;
47
48
    /**
49
     * @var integer The number of times this module is being used
50
     */
51
    private $useCount;
52
53
    /**
54
     * @return string The description of this module
55
     */
56
    public function getDescription()
57
    {
58
        return $this->description;
59
    }
60
61
    /**
62
     * @return string The name of this module
63
     */
64
    public function getName()
65
    {
66
        return $this->name;
67
    }
68
69
    /**
70
     * @return string The running status of this module
71
     */
72
    public function getStatus()
73
    {
74
        return $this->status;
75
    }
76
77
    /**
78
     * @return string The support state of this module
79
     */
80
    public function getType()
81
    {
82
        return $this->supportLevel;
83
    }
84
85
    /**
86
     * @return integer The number of times this module is being used
87
     */
88
    public function getUseCount()
89
    {
90
        return $this->useCount;
91
    }
92
93
    /**
94
     * @param string $response
95
     */
96
    public function __construct($response)
97
    {
98
        parent::__construct($response);
99
100
        $this->description = $this->getResponseValue('description');
101
        $this->name = $this->getResponseValue('name');
102
        $this->status = $this->getResponseValue('status');
103
        $this->supportLevel = $this->getResponseValue('support_level');
104
        $this->useCount = $this->getResponseValue('use_count');
105
    }
106
107
}
108