ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
◀ ilDoc Overview
DenormalizeCarry.php
Go to the documentation of this file.
1
<?php
2
3
namespace
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors
;
4
5
use
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\NormalizingException
;
6
use
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations
;
7
11
final
class
DenormalizeCarry
12
{
13
private
bool
$has_result
=
false
;
14
private
mixed
$result
;
15
19
public
function
__construct
(
20
private
readonly
Transformations
$transformations,
21
private
readonly array|
float
|
bool
|
int
|
string
|
null
$normalized,
22
private
readonly
string
|
object
$expected,
23
) {
24
}
25
26
public
function
transformations
():
Transformations
27
{
28
return
$this->transformations;
29
}
30
32
public
function
normalized
(): array|float|bool|
int
|string|null
33
{
34
return
$this->normalized;
35
}
36
37
public
function
expected
(): string|
object
38
{
39
return
$this->expected;
40
}
41
42
public
function
hasResult
(): bool
43
{
44
return
$this->has_result
;
45
}
46
47
public
function
setResult
(mixed
$result
): void
48
{
49
$this->
result
=
$result
;
50
$this->has_result =
true
;
51
}
52
58
public
function
result
(): mixed
59
{
60
if
($this->has_result ===
false
) {
61
throw
new
NormalizingException
(sprintf(
62
'Unsupported value, expected: %s, got: %s'
,
63
get_debug_type($this->
expected
),
64
get_debug_type($this->
normalized
)
65
));
66
}
67
68
return
$this->result
;
69
}
70
}
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\NormalizingException
Exception thrown when a value cannot be normalized or denormalized.
Definition:
NormalizingException.php:28
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry
Carries normalized data, its expected type and eventual result through denormalization processors.
Definition:
DenormalizeCarry.php:12
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry\__construct
__construct(private readonly Transformations $transformations, private readonly array|float|bool|int|string|null $normalized, private readonly string|object $expected,)
Definition:
DenormalizeCarry.php:19
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry\transformations
transformations()
Definition:
DenormalizeCarry.php:26
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry\setResult
setResult(mixed $result)
Definition:
DenormalizeCarry.php:47
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry\hasResult
hasResult()
Definition:
DenormalizeCarry.php:42
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry\result
result()
Get the result of the denormalization carry.
Definition:
DenormalizeCarry.php:58
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry\$result
mixed $result
Definition:
DenormalizeCarry.php:14
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry\$has_result
bool $has_result
Definition:
DenormalizeCarry.php:13
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry\expected
expected()
Definition:
DenormalizeCarry.php:37
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors\DenormalizeCarry\normalized
normalized()
Definition:
DenormalizeCarry.php:32
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations
Provides a set of transformations for normalizing and denormalizing values.
Definition:
Transformations.php:17
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
ILIAS\Repository\object
object()
Definition:
trait.GlobalDICDomainServices.php:106
ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Processors
Definition:
CollectResources.php:21
components
ILIAS
TestQuestionPool
src
ExportImport
Foundation
Normalize
Processors
DenormalizeCarry.php
Generated on Wed Nov 11 2026 23:10:46 for ILIAS by
1.9.4 (using
Doxyfile
)