| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 19 |
| Ratio | 86.36 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function validate(ResponseInterface $response) |
||
| 28 | { |
||
| 29 | View Code Duplication | if ($response instanceof CookieAwareResponse) { |
|
| 30 | $cookieCount = $response->getCookieCount(); |
||
| 31 | |||
| 32 | if ($cookieCount > $this->maxCookies) { |
||
| 33 | $result = new CheckResult( |
||
| 34 | CheckResult::STATUS_FAILURE, |
||
| 35 | $cookieCount . 'cookies were stored (limit was ' . $this->maxCookies . ').', |
||
| 36 | $cookieCount); |
||
| 37 | } else { |
||
| 38 | $result = new CheckResult( |
||
| 39 | CheckResult::STATUS_SUCCESS, |
||
| 40 | $cookieCount . ' cookies were stored (limit was ' . $this->maxCookies . ').', |
||
| 41 | $cookieCount); |
||
| 42 | } |
||
| 43 | |||
| 44 | $result->addAttribute(new Attribute(' cookies', $response->getCookies(), true)); |
||
| 45 | |||
| 46 | return $result; |
||
| 47 | } |
||
| 48 | } |
||
| 49 | } |
||
| 50 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.