You are here

private function HttpKernel::varToString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/HttpKernel.php \Symfony\Component\HttpKernel\HttpKernel::varToString()
1 call to HttpKernel::varToString()
HttpKernel::handleRaw in vendor/symfony/http-kernel/HttpKernel.php
Handles a request to convert it to a response.

File

vendor/symfony/http-kernel/HttpKernel.php, line 252

Class

HttpKernel
HttpKernel notifies events to convert a Request object to a Response one.

Namespace

Symfony\Component\HttpKernel

Code

private function varToString($var) {
  if (is_object($var)) {
    return sprintf('Object(%s)', get_class($var));
  }
  if (is_array($var)) {
    $a = array();
    foreach ($var as $k => $v) {
      $a[] = sprintf('%s => %s', $k, $this
        ->varToString($v));
    }
    return sprintf('Array(%s)', implode(', ', $a));
  }
  if (is_resource($var)) {
    return sprintf('Resource(%s)', get_resource_type($var));
  }
  if (null === $var) {
    return 'null';
  }
  if (false === $var) {
    return 'false';
  }
  if (true === $var) {
    return 'true';
  }
  return (string) $var;
}