ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\ResponseHandler Class Reference
+ Collaboration diagram for ILIAS\Test\ResponseHandler:

Public Member Functions

 __construct (private readonly HttpService $http,)
 
 sendAsync (mixed $response)
 

Detailed Description

Definition at line 27 of file ResponseHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\ResponseHandler::__construct ( private readonly HttpService  $http)

Definition at line 29 of file ResponseHandler.php.

31 {
32 }

Member Function Documentation

◆ sendAsync()

ILIAS\Test\ResponseHandler::sendAsync ( mixed  $response)
Parameters
Stream | string | mixed$response

Definition at line 37 of file ResponseHandler.php.

37 : void
38 {
39 if (is_string($response)) {
41 } elseif (is_resource($response)) {
43 }
44
45 $this->http->saveResponse(
46 $this->http->response()->withBody($response)
47 );
48 $this->http->sendResponse();
49 $this->http->close();
50 }
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
Definition: Streams.php:64
static http()
Fetches the global http state from ILIAS.
$response
Definition: xapitoken.php:93

References $response, ILIAS\FileDelivery\http(), ILIAS\Filesystem\Stream\Streams\ofResource(), and ILIAS\Filesystem\Stream\Streams\ofString().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: