3 declare(strict_types=1);
44 if (is_int($from) || is_float($from)) {
45 return (
string) $from;
48 if (is_bool($from) || $from === self::BOOL_TRUE_NUMBER || $from === self::BOOL_FALSE_NUMBER) {
49 if ($from === self::BOOL_TRUE || $from === self::BOOL_TRUE_NUMBER) {
50 return self::BOOL_TRUE_STRING;
52 if ($from === self::BOOL_FALSE || $from === self::BOOL_FALSE_NUMBER) {
53 return self::BOOL_FALSE_STRING;
57 if (is_string($from)) {
61 if (is_object($from) && method_exists($from,
'__toString')) {
62 return (
string) $from;
66 sprintf(
'The value "%s" could not be transformed into a string', var_export($from,
true)),
trait DeriveApplyToFromTransform
trait DeriveInvokeFromTransform
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...