-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Make the usage of the role attribute more clear #9901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think in principle this makes sense. Although ideally we wouldn't be using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, what @Girgias said. We should update the skeletons and the docgen templates accordingly.
Currently, the role attribute is 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 PR fixes the problem by a very obtrusive way: by changing the value of all
role="oop"
attributes to the actual class name, likerole="DateTime"
, and by getting rid of allrole="procedural"
attributes as they became unnecessary. This way, class synopsis pages can clearly reference methods, and skip functions.By having this PR, we can get rid of quite a few false positive diff between the output of gen_stub.php and the manual, most notably in ext/mysqli, ext/date and ext/curl. On the other hand, it will take a lot of followup changes in the manual to actually get rid of the diff. :(