ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

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  }
$response
Definition: xapitoken.php:93
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.
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
+ Here is the call graph for this function:

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