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.");
}
->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',