ValidationResult::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
4
namespace Lexuss1979\Validol;
5
6
7
class ValidationResult
8
{
9
    private $result;
10
    private $validated;
11
    private $errors;
12
13 123
    public function __construct($result, $validated, $errors)
14
    {
15 123
        $this->result = $result;
16 123
        $this->validated = $validated;
17 123
        $this->errors = $errors;
18 123
    }
19
20 2
    public function fails()
21
    {
22 2
        return !$this->success();
23
    }
24
25 114
    public function success()
26
    {
27 114
        return $this->result;
28
    }
29
30 2
    public function data()
31
    {
32 2
        return $this->validated;
33
    }
34
35 9
    public function errors()
36
    {
37 9
        return $this->errors;
38
    }
39
40
}