ConfigFormEventsHook: Use self to access static property $lastErrors

This commit is contained in:
raviks789 2023-08-15 10:09:09 +02:00
parent 2265b9d27b
commit dd8875f99f

View File

@ -63,7 +63,7 @@ abstract class ConfigFormEventsHook
*/ */
final public static function getLastErrors() final public static function getLastErrors()
{ {
return static::$lastErrors; return self::$lastErrors;
} }
/** /**
@ -92,7 +92,7 @@ abstract class ConfigFormEventsHook
private static function runEventMethod($eventMethod, Form $form) private static function runEventMethod($eventMethod, Form $form)
{ {
static::$lastErrors = []; self::$lastErrors = [];
if (! Hook::has('ConfigFormEvents')) { if (! Hook::has('ConfigFormEvents')) {
return true; return true;
@ -109,7 +109,7 @@ abstract class ConfigFormEventsHook
try { try {
$hook->$eventMethod($form); $hook->$eventMethod($form);
} catch (\Exception $e) { } catch (\Exception $e) {
static::$lastErrors[] = $e->getMessage(); self::$lastErrors[] = $e->getMessage();
Logger::error("%s\n%s", $e, IcingaException::getConfidentialTraceAsString($e)); Logger::error("%s\n%s", $e, IcingaException::getConfidentialTraceAsString($e));