Passed
Branch feature/throw-422-properly-on-... (3d4d32)
by Pieter
04:18
created

ValidationException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getErrors() 0 3 1
1
<?php
2
3
namespace W2w\Lib\Apie\Exceptions;
4
5
class ValidationException extends ApieException
6
{
7
    private $errors;
8
9
    public function __construct(array $errors, \Exception $previous = null)
10
    {
11
        $this->errors = $errors;
12
        parent::__construct(422, 'A validation error occurred', $previous);
13
    }
14
15
    public function getErrors(): array
16
    {
17
        return $this->errors;
18
    }
19
}
20