| Conditions | 4 |
| Paths | 3 |
| Total Lines | 27 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function generate(AnalysisResult $result, array $params) |
||
| 43 | { |
||
| 44 | $this->output->writeln( |
||
| 45 | "\n" . sprintf('<info>Code Rating:</info> %s', $result->getRatingDescription()) |
||
| 46 | ); |
||
| 47 | |||
| 48 | $fileIndex = 1; |
||
| 49 | foreach ($result->getFiles() as $filename => $file) { |
||
| 50 | |||
| 51 | $relativePath = $file->getRelativeFilename($params['basePath']); |
||
| 52 | $this->output->writeln( |
||
| 53 | sprintf( |
||
| 54 | "\n<comment>File #%d.</comment> %s <question> %s </question>", $fileIndex, $relativePath, |
||
| 55 | $file->getQualityRating() |
||
| 56 | ) . ($file->isOkay() ? ' - OK' : '') |
||
| 57 | ); |
||
| 58 | $index = 1; |
||
| 59 | foreach ($file->getIssues() as $issue) { |
||
| 60 | |||
| 61 | $this->output->writeln( |
||
| 62 | sprintf(' Issue %d: %s', $index, strip_tags($issue->getMessage())) |
||
| 63 | ); |
||
| 64 | $index++; |
||
| 65 | } |
||
| 66 | $fileIndex++; |
||
| 67 | } |
||
| 68 | } |
||
| 69 | |||
| 71 |
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.