#37830 closed enhancement (wontfix)
WP_Query can collapse several methods using __call()
Reported by: | wonderboymusic | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Query | Keywords: | revert |
Focuses: | docs | Cc: |
Description
There are a variety of is_*
methods that also exist as properties. The functions simply cast to bool
. These can all be collapsed using __call()
and @method
annotations.
Patch attached.
Attachments (1)
Change History (7)
#1
@
8 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
#2
@
8 years ago
- Focuses docs added
- Keywords 2nd-opinion added
- Resolution fixed deleted
- Status changed from closed to reopened
May I ask which problem [38356] solves? I'm not really a fan of magic methods because they are … magic. How does this impact performance?
Through the @method
annotation we seem to lose the @since
tag. @DrewAPicture does DevHub support @method
annotations or would we lose the methods/docs of these methods without further adjustments?
#3
@
8 years ago
- Keywords revert added
@ocean90 is correct that we lose data on when these methods were introduced. And I think more importantly we lose a lot of context that is useful to developers unfamiliar with the is_*()
methods.
DevHub doesn't currently support @method
tags, that is to say, the parser of course understands the tags but we don't expose the data in any form on DevHub. I think the preference here would be to keep the methods as non-magic to retain the extra context and versioning information.
In 38356: