* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\DataCollector\Util; @trigger_error('The '.__NAMESPACE__.'\ValueExporter class is deprecated since Symfony 3.2 and will be removed in 4.0. Use the VarDumper component instead.', E_USER_DEPRECATED); /** * @author Bernhard Schussek * * @deprecated since version 3.2, to be removed in 4.0. Use the VarDumper component instead. */ class ValueExporter { /** * Converts a PHP value to a string. * * @param mixed $value The PHP value * @param int $depth Only for internal usage * @param bool $deep Only for internal usage * * @return string The string representation of the given value */ public function exportValue($value, $depth = 1, $deep = false) { if ($value instanceof \__PHP_Incomplete_Class) { return sprintf('__PHP_Incomplete_Class(%s)', $this->getClassNameFromIncomplete($value)); } if (is_object($value)) { if ($value instanceof \DateTimeInterface) { return sprintf('Object(%s) - %s', get_class($value), $value->format(\DateTime::ATOM)); } return sprintf('Object(%s)', get_class($value)); } if (is_array($value)) { if (empty($value)) { return '[]'; } $indent = str_repeat(' ', $depth); $a = array(); foreach ($value as $k => $v) { if (is_array($v)) { $deep = true; } $a[] = sprintf('%s => %s', $k, $this->exportValue($v, $depth + 1, $deep)); } if ($deep) { return sprintf("[\n%s%s\n%s]", $indent, implode(sprintf(", \n%s", $indent), $a), str_repeat(' ', $depth - 1)); } $s = sprintf('[%s]', implode(', ', $a)); if (80 > strlen($s)) { return $s; } return sprintf("[\n%s%s\n]", $indent, implode(sprintf(",\n%s", $indent), $a)); } if (is_resource($value)) { return sprintf('Resource(%s#%d)', get_resource_type($value), $value); } if (null === $value) { return 'null'; } if (false === $value) { return 'false'; } if (true === $value) { return 'true'; } return (string) $value; } private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value) { $array = new \ArrayObject($value); return $array['__PHP_Incomplete_Class_Name']; } } __halt_compiler();----SIGNATURE:----quZf1Wqs5TJLkgWjmsEXLhv6buD6otyrsjLe4FdXcFSLOFjyPP+SxOrGvgApFxaje7ZwSlolGzWzOSFjCCog6F1k4et0m0qPCh7A7fG+iE4VmPn2hadxpaEkchnZgfaPIjART0OpoBvr42Cjt3lue+tAsUwR3hP/eg0y52TiGFqsezpQjA+0P1oZdEPImwpiurkxD1UHMkfagzJddDf8DpVGif3P+JGOxfLP0yEacCylBhgP6AGc8bZcgQrv2JqJ1Y0hVqGLwWx3X5NHd0HX7F2mckOt9gglH/D+MQyGhDgV8qWSPok4U3Bere+BOug1WE0NIlR1Y2Qcys5i3ID4g8/duRP4QeK5J3pklfweH6W7bFoh1PURueDvXh4DxX+56F24aKkKC+w2ov2BhE94rHFzHW0dIGtK02wMpgRHDGmh6kC1/RWnH++s94jMNLSIuoql1V6U3BaST0qJjCWu/RBQlPeq1ZB8d8OJiMkUsBDBuIrlsmfVIKVkwawd9kxgDA/e7USRUxiyWoNwsjR5A/hYrvuMKMpl1zy3mmhqZUOn+Xw8YOhKSCaHASQVGu9wePAGPAh2WSuQ9EeBgzy0ChLrG5FK8hVamxqiAjNpU1VSl+mvDZZt2PMysUhL7EnfXvzbuToeBcR6eI/NQe4JWi3G8qPoCTzYNWe73AFfm00=----ATTACHMENT:----NDc4MzYwNzExMDAyMjE1MiA4NDI4MTY4OTUyMTkyODk2IDUzOTczNDgxNTUzMjk2NDY=