1 <?php declare(strict_types=1);
29 if (is_int($from) || is_float($from) || is_double($from)) {
33 if (is_bool($from) || $from === self::BOOL_TRUE_NUMBER || $from === self::BOOL_FALSE_NUMBER) {
34 if ($from === self::BOOL_TRUE || $from === self::BOOL_TRUE_NUMBER) {
35 return self::BOOL_TRUE_STRING;
37 if ($from === self::BOOL_FALSE || $from === self::BOOL_FALSE_NUMBER) {
38 return self::BOOL_FALSE_STRING;
42 if (is_string($from)) {
46 if (is_object($from) && method_exists($from,
'__toString')) {
47 return (
string) $from;
51 sprintf(
'The value "%s" could not be transformed into a string', $from),
trait DeriveApplyToFromTransform
trait DeriveInvokeFromTransform