Conditions | 2 |
Paths | 2 |
Total Lines | 26 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | public function render(ResultCollection $resultCollection) |
||
29 | { |
||
30 | $stream = fopen('php://temp', 'w'); |
||
31 | fputcsv( |
||
32 | $stream, |
||
33 | [ |
||
34 | 'Name', |
||
35 | 'Status', |
||
36 | 'Reponse Time', |
||
37 | ] |
||
38 | ); |
||
39 | |||
40 | foreach ($resultCollection as $result) { |
||
41 | fputcsv( |
||
42 | $stream, |
||
43 | [ |
||
44 | $result->getName(), |
||
45 | $result->getStatusCode(), |
||
46 | $result->getReponseTime(), |
||
47 | ] |
||
48 | ); |
||
49 | } |
||
50 | rewind($stream); |
||
51 | $this->io->write(stream_get_contents($stream)); |
||
52 | fclose($stream); |
||
53 | } |
||
54 | } |
||
55 |