#[php_function]
pub fn {{ register_fn }}(backend: &mut ext_php_rs::types::ZendObject) -> ext_php_rs::prelude::PhpResult<()> {
    let wrapper = {{ wrapper }}::new(backend);
    let arc: std::sync::Arc<dyn {{ trait_path }}> = std::sync::Arc::new(wrapper);

    let registry = {{ registry_getter }}();
    let mut registry = registry.write();
    registry.register(arc{{ extra_args }}).map_err(|e| ext_php_rs::exception::PhpException::default(
        format!("Failed to register backend: {}", e)
    ))?;
    Ok(())
}
