private static function publishViolations(string $eventClass, ServiceBusContext $context): Promise
    {
        /**
         * @noinspection VariableFunctionsUsageInspection
         *
         * @var \ServiceBus\Services\Contracts\ValidationFailedEvent $event
         */
        $event = \forward_static_call_array([$eventClass, 'create'], [$context->traceId(), $context->violations()]);

        return $context->delivery($event);
    }
private static function publishViolations(string $eventClass, ServiceBusContext $context): Promise
    {
        /**
         * @noinspection VariableFunctionsUsageInspection
         *
         * @var \ServiceBus\Services\Contracts\ValidationFailedEvent $event
         */
        $event = \forward_static_call_array([$eventClass, 'create'], [$context->traceId(), $context->violations()]);

        return $context->delivery($event);
    }
private static function publishViolations ( string $ eventClass , ServiceBusContext $ context ) : Promise { /**
         * @noinspection VariableFunctionsUsageInspection
         *
         * @var \ServiceBus\Services\Contracts\ValidationFailedEvent $event
         */ $ event = \ forward_static_call_array ( [ $ eventClass , 'create' ] , [ $ context -> traceId ( ) , $ context -> violations ( ) ] ) ; return $ context -> delivery ( $ event ) ; }
Publish failed event.

@param string            $eventClass
@param ServiceBusContext $context

@return Promise
Publish failed event .