WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#27940 closed defect (bug) (fixed)

phpDoc for function current_time is wrong

Reported by: arnee Owned by: SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: trivial Version: 2.7
Component: Date/Time Keywords: has-patch 4.0-early commit
Focuses: docs Cc:
PR Number:

Description

Wrong (current)

* @return int|string String if $type is 'gmt', int if $type is 'timestamp'.

Correct:

 * @return int|string String if $type is 'mysql' or not defined, int if $type is 'timestamp'.

Attachments (2)

27940-1.diff (633 bytes) - added by arnee 6 years ago.
27940-2.diff (612 bytes) - added by arnee 6 years ago.

Download all attachments as: .zip

Change History (8)

@arnee
6 years ago

#1 @arnee
6 years ago

  • Keywords has-patch added
  • Severity changed from normal to trivial

#2 @SergeyBiryukov
6 years ago

  • Component changed from Comments to Date/Time
  • Focuses docs added
  • Keywords 4.0-early added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from trunk to 2.7

Introduced in [8606]. $type is a required parameter, so "or not defined" seems inaccurate.

I'd suggest Integer if $type is 'timestamp', string otherwise. Related: [27259].

@arnee
6 years ago

#3 @arnee
6 years ago

Jepp, that's better.

#4 @DrewAPicture
6 years ago

  • Keywords commit added

Hi arnee,

Thanks for the patch. This looks good to go in once we move to the 4.0 milestone :-)

#5 @samuelsidler
6 years ago

  • Milestone changed from Future Release to 4.0

#6 @SergeyBiryukov
6 years ago

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

In 28240:

Correct @return value for current_time().

props arnee.
fixes #27940.

Note: See TracTickets for help on using tickets.