ApiError   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 24
c 0
b 0
f 0
rs 10
ccs 4
cts 4
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getErrors() 0 4 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