Formats an array as a string.
array $args The argument array:
string
public function formatArgs(array $args) {
$result = array();
foreach ($args as $key => $item) {
if ('object' === $item[0]) {
$formattedValue = sprintf("<em>object</em>(%s)", $this
->abbrClass($item[1]));
}
elseif ('array' === $item[0]) {
$formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this
->formatArgs($item[1]) : $item[1]);
}
elseif ('string' === $item[0]) {
$formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset));
}
elseif ('null' === $item[0]) {
$formattedValue = '<em>null</em>';
}
elseif ('boolean' === $item[0]) {
$formattedValue = '<em>' . strtolower(var_export($item[1], true)) . '</em>';
}
elseif ('resource' === $item[0]) {
$formattedValue = '<em>resource</em>';
}
else {
$formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset), true));
}
$result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
}
return implode(', ', $result);
}