| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php namespace Comodojo\Dispatcher\Response\Preprocessor; |
||
| 28 | public function consolidate(Response $response) { |
||
| 29 | |||
| 30 | $cleanup = [ |
||
| 31 | 'Allow', |
||
| 32 | 'Content-Encoding', |
||
| 33 | 'Content-Language', |
||
| 34 | 'Content-Length', |
||
| 35 | 'Content-MD5', |
||
| 36 | 'Content-Type', |
||
| 37 | 'Last-Modified' |
||
| 38 | ]; |
||
| 39 | |||
| 40 | foreach ($cleanup as $header) { |
||
| 41 | $response->getHeaders() |
||
| 42 | ->delete($header); |
||
| 43 | } |
||
| 44 | |||
| 45 | parent::consolidate(); |
||
|
|
|||
| 46 | |||
| 50 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.