ResponseBag   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 31
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getErrors() 0 4 1
A getStatus() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of JSON-API.
5
 *
6
 * (c) Toby Zerner <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tobscure\JsonApi\Exception\Handler;
13
14
/**
15
 * DTO to manage JSON error response handling.
16
 */
17
class ResponseBag
18
{
19
    private $status;
20
    private $errors;
21
22
    /**
23
     * @param int $status
24
     * @param array $errors
25
     */
26 9
    public function __construct($status, array $errors)
27
    {
28 9
        $this->status = $status;
29 9
        $this->errors = $errors;
30 9
    }
31
32
    /**
33
     * @return array
34
     */
35 9
    public function getErrors()
36
    {
37 9
        return $this->errors;
38
    }
39
40
    /**
41
     * @return int
42
     */
43 9
    public function getStatus()
44
    {
45 9
        return $this->status;
46
    }
47
}
48