Completed
Push — master ( c24854...1bac45 )
by Nils
05:40 queued 02:46
created

CheckResult::addAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace whm\Smoke\Rules;
4
5
use whm\Smoke\Http\Response;
6
7
class CheckResult
8
{
9
    const STATUS_SUCCESS = 'success';
10
    const STATUS_FAILURE = 'failure';
11
    const STATUS_NONE = 'none';
12
13
    private $status;
14
    private $value;
15
    private $message;
16
    private $attributes = array();
17
    private $ruleName;
18
19
    /**
20
     * @var Response
21
     */
22
    private $response;
23
24
    /**
25
     * Result constructor.
26
     *
27
     * @param $status
28
     * @param $value
29
     * @param $message
30
     */
31
    public function __construct($status, $message = '', $value = null)
32
    {
33
        $this->status = $status;
34
        $this->value = $value;
35
        $this->message = $message;
36
    }
37
38
    /**
39
     * @return Attribute[]
40
     */
41
    public function getAttributes()
42
    {
43
        return $this->attributes;
44
    }
45
46
    /**
47
     * @param array $attributes
0 ignored issues
show
Documentation introduced by
There is no parameter named $attributes. Did you maybe mean $attribute?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
48
     */
49
    public function addAttribute(Attribute $attribute)
50
    {
51
        $this->attributes[] = $attribute;
52
    }
53
54
    /**
55
     * @return mixed
56
     */
57
    public function getStatus()
58
    {
59
        return $this->status;
60
    }
61
62
    /**
63
     * @return mixed
64
     */
65
    public function getValue()
66
    {
67
        return $this->value;
68
    }
69
70
    /**
71
     * @return mixed
72
     */
73
    public function getMessage()
74
    {
75
        return $this->message;
76
    }
77
78
    /**
79
     * @return Response
80
     */
81
    public function getResponse()
82
    {
83
        return $this->response;
84
    }
85
86
    /**
87
     * @param Response $response
88
     */
89
    public function setResponse(Response $response)
90
    {
91
        $this->response = $response;
92
    }
93
94
    /**
95
     * @return mixed
96
     */
97
    public function getRuleName()
98
    {
99
        return $this->ruleName;
100
    }
101
102
    /**
103
     * @param mixed $ruleName
104
     */
105
    public function setRuleName($ruleName)
106
    {
107
        $this->ruleName = $ruleName;
108
    }
109
}
110