How do we know the required parameters of hook's callback method? I am working on creating a filter module starting with the hook_filter_info file. This hook requires a callback method via a 'process callback' filter setting.

Now the problem is: how do I know what parameters that this callback method requires? I have taken a look at filter.api.php and see this:

function hook_filter_FILTER_process($text, $filter, $format, $langcode, $cache, $cache_id)      {
$text = preg_replace('|\[codefilter_code\](.+?)\[/codefilter_code\]|se', "&lt;pre&gt;$1&lt;/pre&gt;", $text);
return $text;
}


but I have seen this callback filter called like this :

mymodule_process($text, $filter, $format);

mymodule_process($text, $filter, $format, $language);

mymodule_process($text, $filter, $format, $language, $cache);

...

Now how do I know the amount of arguments that this method requires? Or does it require any argument at all?
I've never had to use this specific hook before, but I have found a breakdown of the callback in the Drupal docs:

https://api.drupal.org/api/drupal/modules!filter!filter.api.php/function/callback_filter_process/7

Pretty sure everything you're after will be described in the documentation. You can view all the other Filter API functions within the documentation here:

https://api.drupal.org/api/drupal/modules!filter!filter.api.php/7