replaced some var_export() with json_encode() for better readability
This commit is contained in:
parent
5d963f5460
commit
fb889a2eee
@ -41,7 +41,7 @@ class DbalLogger extends DebugStack
|
||||
parent::startQuery($sql, $params, $types);
|
||||
|
||||
if (null !== $this->logger) {
|
||||
$this->log($sql.' ('.str_replace("\n", '', var_export($params, true)).')');
|
||||
$this->log($sql.' ('.json_encode($params, true).')');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ class RequestListener
|
||||
// add attributes based on the path info (routing)
|
||||
if (false !== $parameters = $this->router->match($request->getPathInfo())) {
|
||||
if (null !== $this->logger) {
|
||||
$this->logger->info(sprintf('Matched route "%s" (parameters: %s)', $parameters['_route'], str_replace("\n", '', var_export($parameters, true))));
|
||||
$this->logger->info(sprintf('Matched route "%s" (parameters: %s)', $parameters['_route'], str_replace("\n", '', json_encode($parameters, true))));
|
||||
}
|
||||
|
||||
$request->attributes->add($parameters);
|
||||
|
@ -44,7 +44,7 @@ class CachedTemplateLocator implements TemplateLocatorInterface
|
||||
$key = md5(serialize($template));
|
||||
|
||||
if (!isset($this->templates[$key])) {
|
||||
throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', var_export($template, true)));
|
||||
throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', json_encode($template, true)));
|
||||
}
|
||||
|
||||
return $this->templates[$key];
|
||||
|
@ -57,7 +57,7 @@ class TemplateLocator implements TemplateLocatorInterface
|
||||
return $this->cache[$key] = $file;
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException(sprintf('Unable to find template "%s" in "%s".', var_export($template, true), $this->path));
|
||||
throw new \InvalidArgumentException(sprintf('Unable to find template "%s" in "%s".', json_encode($template, true), $this->path));
|
||||
}
|
||||
|
||||
$resource = $template['bundle'].'/Resources/views/'.$template['controller'].'/'.$template['name'].'.'.$template['format'].'.'.$template['engine'];
|
||||
@ -65,7 +65,7 @@ class TemplateLocator implements TemplateLocatorInterface
|
||||
try {
|
||||
return $this->kernel->locateResource('@'.$resource, $this->path);
|
||||
} catch (\Exception $e) {
|
||||
throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', var_export($template, true), $this->path), 0, $e);
|
||||
throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', json_encode($template, true), $this->path), 0, $e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ class PhpEngine implements EngineInterface, \ArrayAccess
|
||||
|
||||
// render
|
||||
if (false === $content = $this->evaluate($template, $parameters)) {
|
||||
throw new \RuntimeException(sprintf('The template "%s" cannot be rendered.', var_export($template, true)));
|
||||
throw new \RuntimeException(sprintf('The template "%s" cannot be rendered.', json_encode($template)));
|
||||
}
|
||||
|
||||
// decorator
|
||||
|
Reference in New Issue
Block a user