ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ArrayBasedRequestWrapper.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
31{
36 public function __construct(private array $raw_values)
37 {
38 }
39
40
44 public function retrieve(string $key, Transformation $transformation)
45 {
46 return $transformation->transform($this->raw_values[$key] ?? null);
47 }
48
49
53 public function has(string $key): bool
54 {
55 return isset($this->raw_values[$key]);
56 }
57
61 public function keys(): array
62 {
63 return array_keys($this->raw_values);
64 }
65}
retrieve(string $key, Transformation $transformation)
@inheritDoc
__construct(private array $raw_values)
GetRequestWrapper constructor.
Interface RequestWrapper.
A transformation is a function from one datatype to another.
transform($from)
Perform the transformation.