ApiError::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 9.4285
ccs 4
cts 4
cp 1
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace AppBundle\Response;
4
5
use AppBundle\Response\Infrastructure\AbstractApiResponse;
6
use JMS\Serializer\Annotation as Serializer;
7
8
/**
9
 * @author Vehsamrak
10
 */
11
class ApiError extends AbstractApiResponse
12
{
13
14
    /** @var string[] */
15
    private $errors;
16
17
    /**
18
     * @param string|string[] $errors
19
     * @param int $httpCode
20
     */
21 18
    public function __construct($errors, int $httpCode)
22
    {
23 18
        $this->errors = (array) $errors;
24 18
        $this->httpCode = $httpCode;
25 18
    }
26
27
    /**
28
     * @return string[]
29
     */
30
    public function getErrors(): array
31
    {
32
        return $this->errors;
33
    }
34
}
35