1 | <?php |
||
8 | class CheckResult |
||
9 | { |
||
10 | const STATUS_SUCCESS = 'success'; |
||
11 | const STATUS_FAILURE = 'failure'; |
||
12 | const STATUS_SKIPPED = 'skipped'; |
||
13 | const STATUS_NONE = 'none'; |
||
14 | |||
15 | const HINT_KEY = '__hint'; |
||
16 | |||
17 | const IDENTIFIER_RULE_STANDARD = 'standard'; |
||
18 | const IDENTIFIER_RULE_WITHOUT_SMOKE_PREFIX = 'withoutSmokePrefix'; |
||
19 | |||
20 | private $status; |
||
21 | private $value; |
||
22 | private $message; |
||
23 | |||
24 | /** |
||
25 | * @var Attribute[] |
||
26 | */ |
||
27 | private $attributes = array(); |
||
28 | private $ruleName; |
||
29 | private $url; |
||
30 | |||
31 | private $tool; |
||
32 | private $identifierRule = self::IDENTIFIER_RULE_STANDARD; |
||
33 | |||
34 | /** |
||
35 | * @var UriAwareResponse |
||
36 | */ |
||
37 | private $response; |
||
38 | |||
39 | /** |
||
40 | * Result constructor. |
||
41 | * |
||
42 | * @param $status |
||
43 | * @param $value |
||
44 | * @param $message |
||
45 | */ |
||
46 | public function __construct($status, $message = '', $value = null, $url = null) |
||
53 | |||
54 | /** |
||
55 | * @return Attribute[] |
||
56 | */ |
||
57 | public function getAttributes() |
||
61 | |||
62 | /** |
||
63 | * @return boolean |
||
64 | */ |
||
65 | public function hasAttribute($key) |
||
74 | |||
75 | /** |
||
76 | * @param Attribute $attributes |
||
|
|||
77 | */ |
||
78 | public function addAttribute(Attribute $attribute) |
||
82 | |||
83 | /** |
||
84 | * @param Attribute[] $attributes |
||
85 | */ |
||
86 | public function addAttributes($attributes) |
||
92 | |||
93 | public function setHint($message) |
||
97 | |||
98 | /** |
||
99 | * @return mixed |
||
100 | */ |
||
101 | public function getStatus() |
||
105 | |||
106 | /** |
||
107 | * @return mixed |
||
108 | */ |
||
109 | public function getValue() |
||
113 | |||
114 | /** |
||
115 | * @return string |
||
116 | */ |
||
117 | public function getTool() |
||
121 | |||
122 | /** |
||
123 | * @param string $tool |
||
124 | */ |
||
125 | public function setTool($tool) |
||
129 | |||
130 | /** |
||
131 | * @return string |
||
132 | */ |
||
133 | public function getIdentifierRule() |
||
137 | |||
138 | /** |
||
139 | * @param string $identifier |
||
140 | */ |
||
141 | public function setIdentifierRule($identifierRule) |
||
145 | |||
146 | /** |
||
147 | * @return string |
||
148 | */ |
||
149 | public function getMessage() |
||
153 | |||
154 | /** |
||
155 | * @param string $message |
||
156 | */ |
||
157 | public function setMessage($message) |
||
161 | |||
162 | /** |
||
163 | * @return UriAwareResponse |
||
164 | */ |
||
165 | public function getResponse() |
||
169 | |||
170 | /** |
||
171 | * @param ResponseInterface $response |
||
172 | */ |
||
173 | public function setResponse(ResponseInterface $response) |
||
177 | |||
178 | /** |
||
179 | * @return mixed |
||
180 | */ |
||
181 | public function getRuleName() |
||
185 | |||
186 | /** |
||
187 | * @param mixed $ruleName |
||
188 | */ |
||
189 | public function setRuleName($ruleName) |
||
193 | |||
194 | /** |
||
195 | * @return string |
||
196 | */ |
||
197 | public function getUrl() |
||
201 | } |
||
202 |
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 methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.