WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 2 weeks ago

#46859 closed defect (bug) (fixed)

Incorrect type docblock annotation for $expiresin wp-includes/class-wp-http-cookie.php

Reported by: diddledan Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: HTTP API Keywords: has-patch
Focuses: docs Cc:

Description

The variable $expires in the class WP_HTTP_Cookie defined in wp-includes/class-wp-http-cookie.php is defined by the docblock type annotation to be of a string type. However, occasionally the value null may be assigned. The attached patch fixes the docblock to also state that null is allowed.

Attachments (1)

46859.diff (770 bytes) - added by diddledan 4 months ago.
patch to change type annotation in docblock from string to string|null

Download all attachments as: .zip

Change History (3)

@diddledan
4 months ago

patch to change type annotation in docblock from string to string|null

#1 @SergeyBiryukov
4 months ago

  • Component changed from General to HTTP API
  • Focuses docs added
  • Milestone changed from Awaiting Review to 5.3

#2 @SergeyBiryukov
2 weeks ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 45748:

Docs: Correct @type annotation for WP_HTTP_Cookie::$expires.

Props diddledan.
Fixes #46859.

Note: See TracTickets for help on using tickets.