Message::getCode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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