[wp-trac] [WordPress Trac] #57299: Implement array key type notation
WordPress Trac
noreply at wordpress.org
Thu Dec 8 23:00:46 UTC 2022
#57299: Implement array key type notation
-------------------------+-------------------------------------
Reporter: johnbillion | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: 2nd-opinion | Focuses: docs, coding-standards
-------------------------+-------------------------------------
Comment (by jrf):
How would this play together with the [https://developer.wordpress.org
/coding-standards/inline-documentation-standards/php/#1-1-parameters-that-
are-arrays WP array annotations used for parameters/hooks] ?
How would one go about documenting arrays with `mixed` types, i.e.
different types for different/specific associative array keys ?
Would this also apply to return and hook types ?
''For the record: the WP array format used for parameters/hooks is used
ONLY in WP and nowhere else in the PHP world, which also means that
virtually no tooling supports it unless WP specific extensions have been
written for them. The format proposed by @johnbillion is a far more common
and widely accepted format.''
Also missing any mention of PHP_CodeSniffer in your list of tools, while
that is the typical tooling used to check docs styling in CI in the WP
world.
P.S.: this is not about inline documentation, but about docblocks. You may
want to change that in the description.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57299#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list