Passed
Push — master ( 4c5faf...429320 )
by Chris
04:23
created

FieldOperationCacheBuilder   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A withRequestVarPresent() 0 5 1
A withRuleViolations() 0 3 1
A withUpdateSuccessful() 0 5 1
A withSanitizedInputValue() 0 5 1
A withUpdateAttempted() 0 5 1
1
<?php
2
3
namespace WebTheory\Saveyour\Controllers;
4
5
use WebTheory\Saveyour\Contracts\FieldOperationCacheInterface;
6
7
class FieldOperationCacheBuilder extends AbstractFieldOperationCache implements FieldOperationCacheInterface
8
{
9
    /**
10
     *
11
     */
12 3
    public function withRequestVarPresent(bool $result)
13
    {
14 3
        $this->results['request_var_present'] = $result;
15
16 3
        return $this;
17
    }
18
19
    /**
20
     *
21
     */
22 27
    public function withSanitizedInputValue($value)
23
    {
24 27
        $this->results['sanitized_input_value'] = $value;
25
26 27
        return $this;
27
    }
28
29
    /**
30
     *
31
     */
32 9
    public function withUpdateAttempted(bool $result)
33
    {
34 9
        $this->results['update_attempted'] = $result;
35
36 9
        return $this;
37
    }
38
39
    /**
40
     *
41
     */
42 15
    public function withUpdateSuccessful(bool $result)
43
    {
44 15
        $this->results['update_successful'] = $result;
45
46 15
        return $this;
47
    }
48
49
    /**
50
     *
51
     */
52 18
    public function withRuleViolations(array $violations)
53
    {
54 18
        $this->results['rule_violations'] = $violations;
55 18
    }
56
}
57