Completed
Pull Request — master (#13)
by
unknown
14:29
created

Error   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 46
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getMessage() 0 3 1
A getViolations() 0 3 1
A getCode() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ElevenLabs\Api\Service\Resource;
6
7
/**
8
 * Class Error.
9
 */
10
class Error implements ErrorInterface
11
{
12
    /**
13
     * @var int
14
     */
15
    private $code;
16
17
    /**
18
     * @var string
19
     */
20
    private $message;
21
22
    /**
23
     * @var array
24
     */
25
    private $violations;
26
27
    public function __construct(int $code, string $message, array $violations)
28
    {
29
        $this->code = $code;
30
        $this->message = $message;
31
        $this->violations = $violations;
32
    }
33
34
    /**
35
     * @return int
36
     */
37
    public function getCode(): int
38
    {
39
        return $this->code;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getMessage(): string
46
    {
47
        return $this->message;
48
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function getViolations(): array
54
    {
55
        return $this->violations;
56
    }
57
}
58