Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#48350 closed task (blessed) (fixed)

Stricter docs for WP_Http::processHeaders()

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

Description

I believe the function could better document the parameter and return types. From a look at the source, maybe something like this:

@param string|string[] $headers
@param string          $url

@return array {
    @type array $response {
        @type int    $code
        @type string $message
    }
    @type string|string[]  $newheaders
    @type WP_Http_Cookie[] $cookies
}

+ comments obviously.

Attachments (4)

48350.diff (1.5 KB) - added by valchovski 5 years ago.
48350.2.diff (1.5 KB) - added by deepaklalwani 4 years ago.
Refreshes patch
48350.3.diff (1.6 KB) - added by deepaklalwani 4 years ago.
Fix parameter alignment and add parameter default value details
48350.4.diff (1.6 KB) - added by thimalw 4 years ago.
Fix a typo that was already fixed in trunk

Download all attachments as: .zip

Change History (16)

#1 @johnbillion
5 years ago

  • Keywords needs-patch good-first-bug added

#2 @desrosj
5 years ago

  • Milestone changed from Awaiting Review to 5.4

@valchovski
5 years ago

#3 @valchovski
5 years ago

  • Keywords has-patch added; needs-patch removed

Heya!

Attached a file containing expanded documentation for processHeaders().

Looking forward to any feedback!

#4 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#5 @davidbaumwald
5 years ago

@SergeyBiryukov Are you still reviewing this one for 5.4?

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


5 years ago

#7 @davidbaumwald
5 years ago

  • Keywords needs-refresh added
  • Milestone changed from 5.4 to Future Release

The most recent patch fails against trunk. This ticket still needs a refreshed patch, and with 5.4 Beta 1 landing tomorrow, this is being moved to Future Release. If any maintainer or committer feels this can be included in 5.4 or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

#8 @SergeyBiryukov
5 years ago

  • Milestone changed from Future Release to 5.5

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


4 years ago

@deepaklalwani
4 years ago

Refreshes patch

@deepaklalwani
4 years ago

Fix parameter alignment and add parameter default value details

@thimalw
4 years ago

Fix a typo that was already fixed in trunk

#10 @thimalw
4 years ago

  • Keywords needs-refresh removed

#11 @SergeyBiryukov
4 years ago

  • Type changed from enhancement to task (blessed)

#12 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 48630:

Docs: Improve documentation for WP_Http::processHeaders().

Document the @return value using hash notation.

Props marekdedic, valchovski, davidbaumwald, deepaklalwani, thimalw, SergeyBiryukov.
Fixes #48350.

Note: See TracTickets for help on using tickets.