ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
NullTransformation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
29{
32
36 public function transform($from)
37 {
38 if (is_null($from)) {
39 return null;
40 }
41 if (is_string($from) && trim($from) === '') {
42 return null;
43 }
45 sprintf('The value "%s" could not be transformed into null', var_export($from, true)),
46 'not_null',
47 $from
48 );
49 }
50}
A transformation is a function from one datatype to another.