Add support for validation of missing method synopses#9491
Merged
kocsismate merged 1 commit intophp:PHP-8.2from Sep 7, 2022
Merged
Add support for validation of missing method synopses#9491kocsismate merged 1 commit intophp:PHP-8.2from
kocsismate merged 1 commit intophp:PHP-8.2from
Conversation
98a9e85 to
b7eac0c
Compare
b7eac0c to
f96b17f
Compare
cmb69
approved these changes
Sep 7, 2022
Member
cmb69
left a comment
There was a problem hiding this comment.
This looks like a very useful improvement again. Thank you!
Note that it is probably better to run that against PHP-8.1 for now; at least some of the PHP-8.2 functions are documented in pending PRs.
kocsismate
added a commit
that referenced
this pull request
Sep 7, 2022
* PHP-8.2: Add support for validation of missing method synopses (#9491)
kocsismate
added a commit
that referenced
this pull request
Nov 10, 2022
Currently, the role attribute is mainly used to differentiate OO and procedural "aliases" when they are documented on the same page (e.g. https://www.php.net/manual/en/datetime.diff.php). However, these function-method counterparts are not always aliases in fact according to the stubs (#9491). That's why sometimes the usage of the role attribute is ambiguous, thus syncing the manual with the stubs results in false positive diffs. This change fixes the problem by a very obtrusive way: by changing the value of all role="oop" attributes to the actual class name, like role="DateTime", and by getting rid of all role="procedural" attributes as they became unnecessary. This way, class synopsis pages can clearly reference methods, and skip functions. Additionally, gen_stub.php will be able to generate the correct methodsynopsis role even though a single page describes multiple methods, like `DateTime/DateTimeImmutable/DateTimeInterface::diff()`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for
./build/gen_stub.php --replace-methodsynopses --verify ./ ../doc-en/, similarly to the class synopsis validation. Additionally, we also check if aliases are documented properly. Unfortunately, the output of the script is much longer than the one for classes: