php / doc-base

Tools for the PHP documentation
Other
343 stars 85 forks source link

Generate int/float/null instead of integer/double/NULL in docgen.php #45

Closed TysonAndre closed 1 year ago

TysonAndre commented 3 years ago

For documentation of global constants and class constants.

Address review comments in #44

Girgias commented 3 years ago

Maybe we could use the new PHP 8.0 function get_debug_type()? Although that means a special case to handle resource and require people to use PHP 8.

TysonAndre commented 3 years ago

Maybe we could use the new PHP 8.0 function get_debug_type()? Although that means a special case to handle resource and require people to use PHP 8.

I'd rather not - I'm using 7.4 right now, OSes with Long Term Support (LTS) releases would be using php 7 for a while, and 7.3 still has security support. Some of these scripts claim to be for PHP version 5 in the file headers.

TysonAndre commented 1 year ago

Personally, I'd have gone for an array mapping from gettype() names to desired names. But the is_*() calls work too.

It'd break if they ever changed to match the php7.0 real types, which is why I preferred the verbose version

salathe commented 1 year ago

@kocsismate can you confirm (as could probably be assumed by your approval of the PR) that these changes are, as you requested previously, compatible with the output of gen_stub?

kocsismate commented 1 year ago

@salathe Yes, these changes are compatible with gen_stub.php, however there are some other differences between the output of the two scripts that should also be addressed sometime soon. Latest example: https://github.com/php/doc-en/commit/d6aee4a5004f7d532f24c06ea2ab2ac0b91b8664#diff-6193da7441a9b194146a36138e21738e68cf63c7f17cbd4bff4726d431f2093e

cmb69 commented 1 year ago

Latest example: php/doc-en@d6aee4a#diff-6193da7441a9b194146a36138e21738e68cf63c7f17cbd4bff4726d431f2093e

This would need changes to https://github.com/php/doc-base/blob/master/scripts/docgen/class.tpl (and generally, we should align these .tpl files and the files in https://github.com/php/doc-base/tree/master/RFC/skeletons).