ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Mail\Transformation\Utf8Mb4Sanitizer Class Reference
+ Inheritance diagram for ILIAS\Mail\Transformation\Utf8Mb4Sanitizer:
+ Collaboration diagram for ILIAS\Mail\Transformation\Utf8Mb4Sanitizer:

Public Member Functions

 transform ($from)
 Perform the transformation. More...
 
- Public Member Functions inherited from ILIAS\Refinery\Transformation
 transform ($from)
 Perform the transformation. More...
 
 applyTo (Result $result)
 Perform the transformation and reify possible failures. More...
 
 __invoke ($from)
 Transformations should be callable. More...
 

Detailed Description

Definition at line 29 of file Utf8Mb4Sanitizer.php.

Member Function Documentation

◆ transform()

ILIAS\Mail\Transformation\Utf8Mb4Sanitizer::transform (   $from)

Perform the transformation.

Please use this for transformations. It's more performant than calling invoke.

Parameters
mixed$from
Returns
mixed
Exceptions
InvalidArgumentExceptionif the argument could not be transformed

Implements ILIAS\Refinery\Transformation.

Definition at line 34 of file Utf8Mb4Sanitizer.php.

34 : string
35 {
36 if (!\is_string($from)) {
37 throw new ConstraintViolationException(
38 'Value to be transformed must be of type string',
39 'not_string'
40 );
41 }
42
43 return preg_replace(
44 '/[\x{10000}-\x{10FFFF}]/u',
46 $from
47 );
48 }

References ilDBConstants\MB4_REPLACEMENT.


The documentation for this class was generated from the following file: