mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 09:14:09 +02:00
PlainObjectRenderer: less space for simple objects
This commit is contained in:
parent
3f1d2c6876
commit
813d930166
@ -66,6 +66,17 @@ class PlainObjectRenderer
|
||||
return '{}';
|
||||
}
|
||||
|
||||
if (count($hash) === 1) {
|
||||
$current = self::renderObject(current($hash), $prefix . self::INDENTATION);
|
||||
if (strlen($current) < 62) {
|
||||
return sprintf(
|
||||
'{ %s: %s }',
|
||||
key($hash),
|
||||
$current
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ksort($hash);
|
||||
foreach ($hash as $key => $val) {
|
||||
$vals[] = $prefix
|
||||
|
Loading…
x
Reference in New Issue
Block a user