StatusCode::getMessage()   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 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace HttpStatusCodes;
4
5
class StatusCode implements Contracts\StatusCode
6
{
7
    protected $message;
8
    protected $code;
9
    protected $description;
10
    protected $rfcNumber;
11
12
    /**
13
     * StatusCode constructor.
14
     */
15 6
    public function __construct($data)
16
    {
17 6
        $this->message     = $data['message'];
18 6
        $this->code        = $data['code'];
19 6
        $this->description = $data['description'] ? $data['description'] : '';
20 6
        $this->rfcNumber   = $data['rfc'] ? $data['rfc'] : 0;
21
    }
22
23 4
    public function getMessage(): string
24
    {
25 4
        return $this->message;
26
    }
27
28 1
    public function getCode(): int
29
    {
30 1
        return $this->code;
31
    }
32
33 1
    public function getDescription(): string
34
    {
35 1
        return $this->description;
36
    }
37
38 1
    public function getRFCNumber(): int
39
    {
40 1
        return $this->rfcNumber;
41
    }
42
}
43