Improve phpdoc comments for better type hinting
Fix a trailing semicolon after function definitions, which cause a syntax error in arrays in precompiled templates