ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
NullTransformation.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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.