Message   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 20
ccs 10
cts 10
cp 1
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A validate() 0 7 3
A getText() 0 3 1
A getCode() 0 3 1
1
<?php
2
3
namespace CommerceGuys\AuthNet\DataTypes;
4
5
class Message extends BaseDataType
6
{
7 15
    protected function validate(array $values)
8
    {
9 15
        if (!isset($values['code'])) {
10 1
            throw new \InvalidArgumentException('Messages must have a code');
11
        }
12 14
        if (!isset($values['text'])) {
13 1
            throw new \InvalidArgumentException('Messages must have a text');
14
        }
15 13
    }
16
17 13
    public function getCode()
18
    {
19 13
        return $this->properties['code'];
20
    }
21
22 13
    public function getText()
23
    {
24 13
        return $this->properties['text'];
25
    }
26
}
27