EventListener/ResourceSubscriber.php
public function preRemove(LifecycleEventArgs $args)
    {
        $entity = $args->getObject();
        if ($entity instanceof ResourceInterface) {
            $this->resourceManager->removeResourceFile($entity);

            return;
        }
    }
public function preRemove(LifecycleEventArgs $args)
    {
        $entity = $args->getObject();
        if ($entity instanceof ResourceInterface) {
            $this->resourceManager->removeResourceFile($entity);

            return;
        }
    }
@param LifecycleEventArgs $args

@throws \UnexpectedValueException