src/Component/Legacy.php
private function getPrintableValue($object): string
    {
        if (is_object($object) && method_exists($object, '__toString')) {
            return (string) $object;
        }

        return print_r($object, true);
    }
private function getPrintableValue($object): string
    {
        if (is_object($object) && method_exists($object, '__toString')) {
            return (string) $object;
        }

        return print_r($object, true);
    }
Converts legacy value to string that can be printed (e.g. in log)
calls __toString on the object if it's defined otherwise print_r()