From 42d37b5a0a764f25230564364421ebb3537f4883 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 17 Jun 2021 08:06:54 +0200 Subject: [PATCH] Fix code style issues --- .../install/files/lib/system/event/EventHandler.class.php | 4 ++-- .../plugin/EventListenerPackageInstallationPlugin.class.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/event/EventHandler.class.php b/wcfsetup/install/files/lib/system/event/EventHandler.class.php index 65d79ab005..8110e3d112 100644 --- a/wcfsetup/install/files/lib/system/event/EventHandler.class.php +++ b/wcfsetup/install/files/lib/system/event/EventHandler.class.php @@ -161,9 +161,9 @@ class EventHandler extends SingletonFactory array &$parameters ): void { foreach ($eventListeners as $actionObj) { - $actionClassName = get_class($actionObj); + $actionClassName = \get_class($actionObj); if ($eventObj instanceof IEvent) { - if (!is_callable($actionObj)) { + if (!\is_callable($actionObj)) { throw new \LogicException("Event listener object of class '{$actionClassName}' is not callable."); } diff --git a/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php index c16611495e..e2abd0aa1d 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php @@ -265,14 +265,14 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat ->objectProperty('listenerclassname') ->label('wcf.acp.pip.eventListener.listenerClassName') ->required() - ->addValidator(new FormFieldValidator('callable', function (ClassNameFormField $formField) { + ->addValidator(new FormFieldValidator('callable', static function (ClassNameFormField $formField) { $listenerClassName = $formField->getValue(); /** @var TextFormField $eventClassNameField */ $eventClassNameField = $formField->getDocument()->getNodeById('eventClassName'); $eventClassName = $eventClassNameField->getValue(); - + if (\is_subclass_of($eventClassName, IEvent::class)) { - if (!is_callable(new $listenerClassName)) { + if (!\is_callable(new $listenerClassName())) { $formField->addValidationError( new FormFieldValidationError( 'noCallable', -- 2.20.1