| Conditions | 4 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 5 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 42 | public function render(ResultCollection $resultCollection) |
||
| 43 | { |
||
| 44 | $format = '[%s][%s] %s - %s%s'; |
||
| 45 | |||
| 46 | $errorFormat = ' - <bg=red>%s</>'; |
||
| 47 | |||
| 48 | $statusGuesser = new StatusGuesser(); |
||
| 49 | |||
| 50 | foreach ($resultCollection as $result) { |
||
| 51 | $errorLog = $result->getHandlerError(); |
||
| 52 | $this->io->write( |
||
| 53 | sprintf( |
||
| 54 | $format, |
||
| 55 | $statusGuesser->isFailed($result) ? 'FAIL' : 'OK', |
||
| 56 | $result->getStatusCode(), |
||
| 57 | $result->getUrl()->getName(), |
||
| 58 | $result->getReponseTime(), |
||
| 59 | (null !== $errorLog) ? sprintf($errorFormat, $result->getHandlerError()) : '' |
||
| 60 | )."\n" |
||
| 61 | ); |
||
| 62 | } |
||
| 63 | } |
||
| 64 | } |
||
| 65 |