ILIAS  release_7 Revision v7.30-3-g800a261c036
IntegerTransformation.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
4/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
5
11
16
18{
21
25 public function transform($from)
26 {
27 if (false === is_int($from)) {
29 'The value MUST be of type integer',
30 'not_integer'
31 );
32 }
33 return (int) $from;
34 }
35}
An exception for terminatinating execution or to throw for unit testing.
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
A transformation is a function from one datatype to another.