| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | public function send(IRequest $httpRequest, IResponse $httpResponse) |
||
| 45 | { |
||
| 46 | if (!$this->response) { |
||
|
|
|||
| 47 | echo 'Generate or set response first'; |
||
| 48 | return; |
||
| 49 | } |
||
| 50 | |||
| 51 | $httpResponse->setContentType('text/xml'); |
||
| 52 | $httpResponse->setExpiration(false); |
||
| 53 | $httpResponse->setCode($this->getCode()); |
||
| 54 | |||
| 55 | echo $this->response; |
||
| 56 | } |
||
| 57 | } |
||
| 58 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: