Skip to content

PHP 7.4 | Classes/NewTypedProperties: add XML documentation#2001

Merged
jrfnl merged 3 commits intoPHPCompatibility:developfrom
okkun-sh:docs/classes-newtypedproperties
Nov 30, 2025
Merged

PHP 7.4 | Classes/NewTypedProperties: add XML documentation#2001
jrfnl merged 3 commits intoPHPCompatibility:developfrom
okkun-sh:docs/classes-newtypedproperties

Conversation

@okkun-sh
Copy link
Copy Markdown
Contributor

Summary

Add XML documentation for the Classes/NewTypedProperties sniff.

This contributes to #1285.

I'm working through the list in #1285, picking sniffs that seem feasible to document.
Please let me know if there are any concerns with this approach.

Questions

  1. Should this include version-specific details (PHP 8.0+ types like mixed, union, etc.)?
    The sniff has detailed version info in code comments, but I kept it simple for now.

Copy link
Copy Markdown
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

Thanks for this PR @okkun-sh !

Questions

  1. Should this include version-specific details (PHP 8.0+ types like mixed, union, etc.)?
    The sniff has detailed version info in code comments, but I kept it simple for now.

Good question and one I find difficult to find an answer to as well.

If I compare it to a similar sniff which already has docs - PHPCompatibility.Classes.NewTypedConstants, the docs for both sniffs follow the same approach, however, there have not been any new "types" introduced in PHP since the introduction of typed constants, while for typed properties that's a different matter.

I've left a suggestion inline on how this could possibly be addressed. Keep in mind, this is only a suggestion, feel free to let it inspire you to a better version than my suggestion.

I'm working through the list in #1285, picking sniffs that seem feasible to document. Please let me know if there are any concerns with this approach.

No concerns, just appreciation ;-)

If/when more people would start actively contributing to the action items from #1285, it would help to "claim" some sniffs in advance (by leaving a comment on the ticket) to prevent multiple people accidentally working on docs for the same sniffs, but as you are currently the only one actively picking up action items from #1285, I think the risk of that happening at this moment is very small.

okkun-sh and others added 2 commits November 30, 2025 23:32
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
@okkun-sh
Copy link
Copy Markdown
Contributor Author

@jrfnl
I've applied the suggestions!

If more people start contributing, I'll leave a comment.
Thanks for always explaining things!

@jrfnl jrfnl added this to the 10.0.0-alpha3 milestone Nov 30, 2025
Copy link
Copy Markdown
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

Thanks @okkun-sh ! Looking forward to your next contribution.

@jrfnl jrfnl merged commit baecae7 into PHPCompatibility:develop Nov 30, 2025
36 checks passed
@okkun-sh okkun-sh deleted the docs/classes-newtypedproperties branch December 1, 2025 13:48
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