ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
FloatTransformation.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types=1);
3
4
/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
5
10
namespace
ILIAS\Refinery\To\Transformation
;
11
12
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
13
use
ILIAS\Refinery\Transformation
;
14
use
ILIAS\Refinery\ConstraintViolationException
;
15
16
class
FloatTransformation
implements
Transformation
17
{
18
use
DeriveApplyToFromTransform
;
19
23
public
function
transform
($from)
24
{
25
if
(
false
=== is_float($from)) {
26
throw
new
ConstraintViolationException
(
27
'The value MUST be of type float'
,
28
'not_float'
29
);
30
}
31
return
(
float
) $from;
32
}
33
37
public
function
__invoke
($from)
38
{
39
return
$this->
transform
($from);
40
}
41
}
ILIAS\Refinery\To\Transformation\FloatTransformation\transform
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
Definition:
FloatTransformation.php:23
ILIAS\Refinery\To\Transformation\FloatTransformation
Definition:
FloatTransformation.php:16
Transformation
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:13
ILIAS\Refinery\To\Transformation
Definition:
BooleanTransformation.php:10
ILIAS\Refinery\To\Transformation\FloatTransformation\__invoke
__invoke($from)
Transformations should be callable.This MUST do the same as transform.
Definition:
FloatTransformation.php:37
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:14
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:17
ConstraintViolationException
src
Refinery
To
Transformation
FloatTransformation.php
Generated on Wed Sep 3 2025 20:01:29 for ILIAS by
1.8.13 (using
Doxyfile
)