It would be nice if there was an extra option in the Soy compiler which can copy the annotations from the Soy templates to the generated PHP functions.
/**
* Test template
* @annotation custom annotation
*/
{template .test}
test
{/template}
/**
* Test template
* @annotation custom annotation
* @param array|null $opt_data
* @param array|null $opt_ijData
* @return \Goog\Soy\SanitizedContent
*/
public static function test($opt_data = null, $opt_ijData = null) {
$output = 'test';
return new \Goog\Soy\SanitizedHtml($output);
}
But of course this output is just an example/idea, the format can be changed if it is necessary. Also, it would nice to keep the original @param annotations as @soyparam or something like this.