You mean like https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/Compiler/AddFieldTypePass.php#L56 or https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/Compiler/RegisterLimitationTypePass.php#L39 ?