StatusCode   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 7
eloc 13
c 2
b 1
f 0
dl 0
loc 36
ccs 13
cts 13
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getMessage() 0 3 1
A getRFCNumber() 0 3 1
A getCode() 0 3 1
A __construct() 0 6 3
A getDescription() 0 3 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