When I interpret the description (This callback will receive these parameters: array $tag, array $rendererStates, XenForo_BbCode_Formatter_Base $formatter.) correct, the Php class gets those three parameters handed over. So I guess it needs to take them as input logically, but which of them exactly includes which details?
Even just having some example code with a couple of comments would be huge if someone has written one of these and has it hanging around. Add in a screenshot from the ACP, and you have a pretty solid contribution to the "Tips and Guides" section of the RM.