* * 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:----lBpsuaAnokqZsUGnVXL2K8wrgwns2/IxdbrD6J7LBgvPAYmq5PBT9IlLji2BvOMJU7W0sp9V+Ug5/9DCqc5nwRaXsvo2JvIrBd+B2bWW89phNGX1XxsmjD+zUH5q+2fagW51LGigDcTbgsqz2Uw54Ixx/P8iJhaO6sqYeoaQ2HArJDLQ9XXTdE+OmrG7l8i4/Gqx25NdXumOeNuSmH2BBXlQoevpB1Cx5a5g5tFpHULPI+LS2cjhpk5xY55C9r79tUm5f7xszD3RO4KbAK85RRr40ob1RgI6dORxbhPEsk8jbAoDsd7qY2klt9pb2UoV7VPyUL67dMsO69fS/yxsjQ6xLtERpYte1eFqEi8GPUyXHwpFR2zfZFxnLQFDE68hCpBgJ6IkG0YdMhK7yFHl3iLpcR8AmrIcYzXzKveEThKTQbmXJj2JxMjEUuLN/nTOHdYt3oM2FbWhA5H+ujaYnk+9/Cmo6WYttOON2Q5qJ6wnOKGHdzEpBQMaoHNGtjokYtJw0uxxYIUtXYQMzaoQgqt2nZPVRzhn0gH2Mbp23Q3OVPBYvd7b4Eh/+gXCsi7Oz9H+ry8aMqH+CqqbskL/mIO2aZ/5nSIAXirfvouMf1A/ufgAxLBBAepTA5e0LPqGMN/VKxcCNayPzh34K1NAvwWr+R49giy+W3UI5rYWd/I=----ATTACHMENT:----OTkyMzQwMzE4MDE5NjI1MSAzMTA4NDkwOTk4NjAwMjUgMzI1MzE5NzQ0MjQ4NTMw