ValidationResult   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A fails() 0 3 1
A data() 0 3 1
A errors() 0 3 1
A success() 0 3 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 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
}