ResponseBag::getErrors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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