| Conditions | 5 |
| Paths | 5 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 7 | protected function getContent(InputInterface $input) |
|
| 44 | { |
||
| 45 | 7 | switch ($input->getArgument('test')) { |
|
| 46 | 7 | case 'json': |
|
| 47 | 2 | return $this->getTestContent( |
|
| 48 | 2 | 'tweets_32_bits.json'); |
|
| 49 | 5 | case 'json_with_retweet': |
|
| 50 | 1 | return $this->getTestContent( |
|
| 51 | 1 | 'tweet_with_retweet.json'); |
|
| 52 | 4 | case 'not_array': |
|
| 53 | // Return null instead of JSON |
||
| 54 | 1 | return; |
|
| 55 | 3 | case 'empty_array': |
|
| 56 | // Return an empty array instead of JSON |
||
| 57 | 2 | return []; |
|
| 58 | default: |
||
| 59 | // Normal behaviour |
||
| 60 | 1 | return parent::getContent($input); |
|
| 61 | } |
||
| 62 | } |
||
| 63 | } |
||
| 64 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.