ValidationException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace GloBee\PaymentApi\Exceptions\Validation;
4
5
class ValidationException extends \InvalidArgumentException
6
{
7
    /**
8
     * @var array
9
     */
10
    private $errors;
11
12
    /**
13
     * ValidationException constructor.
14
     *
15
     * @param array  $errors
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
16
     * @param string $message
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
17
     */
18 16
    public function __construct(array $errors, $message = 'Validation Failed')
0 ignored issues
show
Coding Style introduced by
Type hint "string" missing for $message
Loading history...
19
    {
20 16
        parent::__construct($message);
21 16
        $this->errors = $errors;
22 16
    }
23
24
    /**
25
     * @return array
26
     */
27 1
    public function getErrors()
28
    {
29 1
        return $this->errors;
30
    }
31
}
32