Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#48349 closed defect (bug) (reported-upstream)

Requests::request_multiple() should have the option documentation in phpDoc

Reported by: marekdedic's profile marekdedic Owned by:
Milestone: Priority: normal
Severity: minor Version: 5.2
Component: HTTP API Keywords: good-first-bug has-patch
Focuses: docs Cc:

Description

Currently, the $options argument field is documented in the description:

https://developer.wordpress.org/reference/classes/requests/request_multiple/

I believe it could be documented using phpDoc directly like

@param array $options {
    Description.

    @type ...
}

Attachments (2)

48349.patch (5.0 KB) - added by hogetan 5 years ago.
Fix option description
48349.2.patch (5.0 KB) - added by hogetan 5 years ago.
Remove debug code

Download all attachments as: .zip

Change History (10)

#1 @marekdedic
5 years ago

Also, I believe the return value could be narrowed from array to Requests_Response[]|Requests_Exception[].

#2 @johnbillion
5 years ago

  • Keywords needs-patch good-first-bug added

#3 @desrosj
5 years ago

  • Milestone changed from Awaiting Review to 5.4

#4 @SergeyBiryukov
5 years ago

  • Component changed from General to HTTP API

@hogetan
5 years ago

Fix option description

@hogetan
5 years ago

Remove debug code

#5 @spenserhale
5 years ago

  • Keywords has-patch added; needs-patch removed
Last edited 5 years ago by spenserhale (previous) (diff)

#6 @dd32
5 years ago

As the Requests class is an external project, https://developer.wordpress.org/reference/classes/requests/ probably shouldn't even exist, and documentation improvements should probably be discussed on it's Github project page.

#7 @adamsilverstein
5 years ago

  • Milestone changed from 5.4 to Future Release

I agree, it seems like the doc changes should be proposed and made upstream in the Requests project. Once we get changes merged there we can follow up to upgrade the core bundled version. Otherwise, if we make these changes only locally in WordPress core, they would get overwritten if/when we update the Requests version we bundle.

I searched through the open issues and didn't find anything about the documenting the option array there. It would be great to start by opening an issue describing the change. I believe there may be other opportunities to improve inline docs, especially arrays, elsewhere in the project.

Marking this ticket as future release for now, until we get the changes merged upstream.

#8 @johnbillion
4 years ago

  • Milestone Future Release deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.