JsonApiResponse::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace SMartins\JsonHandler\Responses;
4
5
class JsonApiResponse
6
{
7
    protected $status;
8
9
    protected $errors;
10
11
    public function getStatus()
12
    {
13
        return $this->status;
14
    }
15
16
    public function status()
17
    {
18
        return $this->getStatus();
19
    }
20
21
    public function getErrors()
22
    {
23
        return $this->errors;
24
    }
25
26
    public function errors()
27
    {
28
        return $this->getErrors();
29
    }
30
31
    public function setStatus($status)
32
    {
33
        $this->status = $status;
34
    }
35
36
    public function setErrors($errors)
37
    {
38
        $this->errors = $errors;
39
    }
40
41
    public function toArray()
42
    {
43
        return ['errors' => $this->errors()];
44
    }
45
}
46