Completed
Push — master ( 0365a3...8a81d1 )
by Alexey
02:12
created

ValidationResult   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 27
ccs 13
cts 13
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A data() 0 2 1
A __construct() 0 5 1
A fails() 0 2 1
A errors() 0 2 1
A success() 0 2 1
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 1
    public function __construct($result, $validated, $errors)
14
    {
15 1
        $this->result = $result;
16 1
        $this->validated = $validated;
17 1
        $this->errors = $errors;
18 1
    }
19
20 1
    public function success(){
21 1
        return $this->result;
22
    }
23
24 1
    public function fails(){
25 1
        return ! $this->success();
26
    }
27
28 1
    public function data(){
29 1
        return $this->validated;
30
    }
31
32 1
    public function errors(){
33 1
        return $this->errors;
34
    }
35
36
}