Closure finisher 

The "Closure finisher" can only be used in programmatically-created forms. It allows you to execute your own finisher code without implementing/ declaring a finisher.

Closure finisher option 

closure

closure
Type
?\Closure
Required

true

Default
null

The name of the field as shown in the form.

Using the closure finisher programmatically 

This finisher can only be used in programmatically-created forms. It allows you to execute your own finisher code without implementing/ declaring a finisher.

Code example:

<?php

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Form\Domain\Finishers\ClosureFinisher;
use TYPO3\CMS\Form\Domain\Model\FormDefinition;

class SomeClass
{
    private function addClosureFinisher(FormDefinition $formDefinition)
    {

        $closureFinisher = GeneralUtility::makeInstance(ClosureFinisher::class);
        $closureFinisher->setOption('closure', function ($finisherContext)
        {
            $formRuntime = $finisherContext->getFormRuntime();
            // ...
        });
        $formDefinition->addFinisher($closureFinisher);
    }
}
Copied!

This finisher is implemented in \TYPO3\CMS\Form\Domain\Finishers\ClosureFinisher .