ValidationFailureException::getFailures()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Mbright\Validation\Exception;
4
5
use Mbright\Validation\Failure\FailureCollection;
6
7
class ValidationFailureException extends \Exception
8
{
9
    /**
10
     * Failures from the filter.
11
     *
12
     * @var FailureCollection
13
     */
14
    protected $failures;
15
16
    /**
17
     * The subject being filtered.
18
     *
19
     * @var mixed
20
     */
21
    protected $subject;
22
23
    /**
24
     * Sets the failures from the filter.
25
     *
26
     * @param FailureCollection $failures The filter failures.
27
     *
28
     * @return null
29
     */
30
    public function setFailures(FailureCollection $failures): void
31
    {
32
        $this->failures = $failures;
33
    }
34
35
    /**
36
     * Gets the failures from the filter.
37
     *
38
     * @return FailureCollection
39
     */
40
    public function getFailures(): FailureCollection
41
    {
42
        return $this->failures;
43
    }
44
45
    /**
46
     * Sets the subject of the filter.
47
     *
48
     * @param mixed $subject The subject being filtered.
49
     *
50
     * @return null
51
     */
52
    public function setSubject($subject): void
53
    {
54
        $this->subject = $subject;
55
    }
56
57
    /**
58
     * Gets the subject of the filter.
59
     *
60
     * @return mixed
61
     */
62
    public function getSubject()
63
    {
64
        return $this->subject;
65
    }
66
}
67