We can use calls of `assert_instances_of()` in the generated documentation. So instead of `array $hunks` we can print `ArcanistDiffHunk[] $hunks`.
NOTE: `assert_instances_of()` can be used also for non-parameters (and it really [[https://secure.phabricator.com/diffusion/P/browse/master/src/applications/differential/parser/changeset/DifferentialChangesetParser.php;b90d41dd907c2a0f$1177-1179 | is (this link is broken for some reason)]]).
It will be hard to avoid false positives in code like:
function f(array $a) {
$a = array(new stdClass);
assert_instances_of($a, 'stdClass');
}
But it's not worth the effort to deal with such code.