Opened 23 months ago
Closed 23 months ago
#58348 closed defect (bug) (invalid)
API Doc: replace wrong string[] type with correct one - array
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.3 |
Component: | General | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
Wordpress API docs have a lot of places where string[] type is present. PHP doesn't support such data type. This lead into confusions and errors. The "string[]" data type should replaced with "array" data type.
Example:
wp_check_filetype( string $filename, string[] $mimes = null ): array
Fixed:
wp_check_filetype( string $filename, array $mimes = null ): array
Attachments (1)
Change History (5)
#2
@
23 months ago
- Keywords has-patch added
Thanks for the ticket . I have applied patch as per your suggestion .
#4
@
23 months ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Thanks for the ticket. This is phpDoc array type notation, see the "Arrays" section on https://docs.phpdoc.org/2.9/references/phpdoc/types.html#arrays for all the details.
Note: See
TracTickets for help on using
tickets.
If array argument can be null then function signature should look following: