ILIAS  release_8 Revision v8.24
NullTransformation.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...