This pull request makes it possible to generate one-line apidoc comments for XP Compiler.
Example
Input using array component types, which PHP doesn't syntactically support:
function main(array<string> $args): int { ... }
XP Compiler emits this type as array, erasing the component type. However, we still want IDEs and reflective access to pick up the more precise type, so apidoc is emitted. To ensure line number stay intact, we need to emit the comment as a single line on the same line as the function declaration:
/** @param string[] */ function main(array $args): int { ... }
This pull request makes it possible to generate one-line apidoc comments for XP Compiler.
Example
Input using array component types, which PHP doesn't syntactically support:
XP Compiler emits this type as array, erasing the component type. However, we still want IDEs and reflective access to pick up the more precise type, so apidoc is emitted. To ensure line number stay intact, we need to emit the comment as a single line on the same line as the function declaration: