| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class ServerApi |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Tells if the headers have been sent and no more headers can be provided. |
||
| 15 | * @return bool True if no more headers can be provided, false otherwise |
||
| 16 | */ |
||
| 17 | 1 | public function isHeadersSent(): bool |
|
| 18 | { |
||
| 19 | 1 | return headers_sent(); |
|
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Adds a header line to be sent to the browser. |
||
| 24 | * @param string $line The header line to send to browser |
||
| 25 | * @codeCoverageIgnore |
||
| 26 | */ |
||
| 27 | public function sendHeaderLine(string $line): void |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Outputs the given string to the browser. |
||
| 34 | * @param string $output The string to output |
||
| 35 | */ |
||
| 36 | 1 | public function output(string $output): void |
|
| 37 | { |
||
| 38 | 1 | echo $output; |
|
| 39 | 1 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Tells if the connection to the user have been terminated and no more output can be sent. |
||
| 43 | * @return bool True if no more output can be sent, false otherwise |
||
| 44 | */ |
||
| 45 | 1 | public function isConnectionAborted(): bool |
|
| 48 | } |
||
| 49 | } |
||
| 50 |