f4a49b8ba6550ef1f57c226d8a41b628cdbc8cf1
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 /**
4 * @see https://github.com/laminas/laminas-httphandlerrunner for the canonical source repository
5 * @copyright https://github.com/laminas/laminas-httphandlerrunner/blob/master/COPYRIGHT.md
6 * @license https://github.com/laminas/laminas-httphandlerrunner/blob/master/LICENSE.md New BSD License
7 */
8
9 declare(strict_types=1);
10
11 namespace Laminas\HttpHandlerRunner\Emitter;
12
13 use Psr\Http\Message\ResponseInterface;
14
15 interface EmitterInterface
16 {
17 /**
18 * Emit a response.
19 *
20 * Emits a response, including status line, headers, and the message body,
21 * according to the environment.
22 *
23 * Implementations of this method may be written in such a way as to have
24 * side effects, such as usage of header() or pushing output to the
25 * output buffer.
26 *
27 * Implementations MAY raise exceptions if they are unable to emit the
28 * response; e.g., if headers have already been sent.
29 *
30 * Implementations MUST return a boolean. A boolean `true` indicates that
31 * the emitter was able to emit the response, while `false` indicates
32 * it was not.
33 */
34 public function emit(ResponseInterface $response) : bool;
35 }