Skip to content

gen_stub: Skip non-refentry documents and manual synopses in stub generation - #25883

Open
jordikroon wants to merge 2 commits into
php:PHP-8.6from
jordikroon:genstub-skip-synopses
Open

jordikroon wants to merge 2 commits into
php:PHP-8.6from
jordikroon:genstub-skip-synopses

Conversation

@jordikroon

Copy link
Copy Markdown
Member

gen_stub.php overwrites every methodsynopsis it can match by name. Some of these don't match the stubs on purpose.
For example the extra signatures of overloaded functions and methods or old signatures in the 7.3 and 8.2 migration guides.

This PR skips condition="manual" and non-refentry documents. The latter as a fix to skip migration documents.

See: php/doc-en#6170

Comment thread build/gen_stub.php Outdated
$documentedFuncMap[$funcInfo->name->__toString()] = $funcInfo->name->__toString();

// Hand-maintained synopses are never regenerated
if ($methodSynopsis->getAttribute("condition") === "manual") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally, I find the "manual" value a bit ambiguous in the context of the PHP manual 😅 I could imagine using some other value, like no-auto-update or similar.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that's fair enough. How about stub-override? I prefer to write it's purpose rather than the instruction.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like my suggestion, but I didn't have an AHA! moment when reading stub-override either. Not bad, but not the best one. :) either way, let's wait a little bit in the hope that someone else will chime in with another idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants