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

withRequestVarPresent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
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