Fix code style issues
authorMatthias Schmidt <gravatronics@live.com>
Thu, 17 Jun 2021 06:06:54 +0000 (08:06 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 17 Jun 2021 06:06:54 +0000 (08:06 +0200)
wcfsetup/install/files/lib/system/event/EventHandler.class.php
wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php

index 65d79ab00573650bf1979524d031bc140f05552e..8110e3d1124ac7fe39b6bf1f087dd5b51a0eb166 100644 (file)
@@ -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.");
                 }
 
index c16611495ee6b0ab89f08f9c30154dd9b76bd6d2..e2abd0aa1df24e5e9bbde65bebf94cbf39452457 100644 (file)
@@ -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',