19declare(strict_types=1);
28use Psr\Http\Message\ServerRequestInterface;
37 private readonly IliasHttpServices
$http,
44 return $this->
http->request();
54 return $this->
get($key, $this->
refinery->byTrying([
56 $this->refinery->kindlyTo()->string(),
57 $this->refinery->custom()->transformation(
static fn(array $value):
string|
int => $value[0])
63 return $this->
get($key, $this->
refinery->custom()->transformation(
64 static fn(array|
string $value): array|
string => $value === self::ALL_OBJECTS || $value[0] === self::ALL_OBJECTS
67 static fn(
string $value):
string|
int => count(explode(
'_', $value)) > 1 ? $value : (
int) $value,
75 $wrapper = $this->
http->wrapper();
78 $wrapper->post()->has($key) => $wrapper->post()->retrieve($key, $t),
79 $wrapper->query()->has($key) => $wrapper->query()->retrieve($key, $t),
95 $this->
http->saveResponse($this->
http->response()->withBody($response));
96 $this->
http->sendResponse();
100 public function has(
string $key): bool
102 return $this->
http->wrapper()->query()->has($key) || $this->
http->wrapper()->post()->has($key);
__construct(private readonly IliasHttpServices $http, private readonly Refinery $refinery)
sendAsync(mixed $response)
resolveRowParameter(string $key)
resolveRowParameters(string $key)
Stream factory which enables the user to create streams without the knowledge of the concrete class.
static ofString(string $string)
Creates a new stream with an initial value.
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
readonly HttpService $http
static http()
Fetches the global http state from ILIAS.