mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
Macro: Fix typo and simplify the code
This commit is contained in:
parent
41787d91bf
commit
d6ceb9ad11
@ -62,7 +62,7 @@ class Macro
|
|||||||
*/
|
*/
|
||||||
public static function resolveMacro($macro, $object)
|
public static function resolveMacro($macro, $object)
|
||||||
{
|
{
|
||||||
if (isset(self::$icingaMacros[$macro]) && isset($object->{self::$icingaMacros[$macro]})) {
|
if (isset(self::$icingaMacros[$macro], $object->{self::$icingaMacros[$macro]})) {
|
||||||
return $object->{self::$icingaMacros[$macro]};
|
return $object->{self::$icingaMacros[$macro]};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,9 +83,14 @@ class Macro
|
|||||||
}
|
}
|
||||||
|
|
||||||
$value = null;
|
$value = null;
|
||||||
Logger::debug('Unable to resolve macro "%s" on object "%s". An error occured: %s', $macro, $objectName, $e);
|
Logger::debug(
|
||||||
|
'Unable to resolve macro "%s" on object "%s". An error occurred: %s',
|
||||||
|
$macro,
|
||||||
|
$objectName,
|
||||||
|
$e
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value !== null ? $value : $macro;
|
return $value ?? $macro;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user